SQL database connection

2123
4
02-17-2012 08:18 AM
jp
by
New Contributor II
Hi,

I am trying to connect to sql database (.mdf file) but couldn't successfully create a connection string.

Here is what I tested with  -


1.  Data Source=.\SQLEXPRESS;AttachDbFilename=C:\.....\test.mdf;User Instance=True;Trusted_Connection=Yes;
2.  Server=.\SQLEXPRESS;AttachDbFilename=C:\....\Test_models.mdf;User Instance=True;Trusted_Connection=Yes;MultipleActiveResultSets=True;Pooling=True;Connect Timeout=60
3.  Server=.\SQLEXPRESS;Database=C:\.....\Test_model.mdf;User Instance=True;Trusted_Connection=Yes;

Has anybody tried connecting to sql database file (2008) with absolute path?

Is it the User Interface property thats not supported by ESRI?

Any ideas?

Thanks!
0 Kudos
4 Replies
DuncanHornby
MVP Notable Contributor
Just an idea but have you tried to link to the database using ArcCatalog? This will at least prove that you can connect to it (so not some weird permission issue) and you'll be able to see the properties of the connection so you can ensure you have a correct connection string?

Well thats what I would do first...
0 Kudos
jp
by
New Contributor II
I tried connecting in ArcCatalog.

Selected Microsoft OLE DB Provider for SQL Server

Connection -
1. server name : .\SQLEXPRESS,
2. authentication: OSA,
3. Attach a database file - path to the database

When I test the connection get this error -

Test connection failed because of an error in initializing provider. CREATE DATABASE permission denied in database 'master'.

Any ideas?

Thanks!
0 Kudos
GeorgeFaraj
Occasional Contributor III
I tried connecting in ArcCatalog.

Selected Microsoft OLE DB Provider for SQL Server

Connection -
1. server name : .\SQLEXPRESS,
2. authentication: OSA,
3. Attach a database file - path to the database

When I test the connection get this error -

Test connection failed because of an error in initializing provider. CREATE DATABASE permission denied in database 'master'.

Any ideas?

Thanks!


How are you logging in to that machine?  Is it a domain login?  OSA says to use your machine login and SQL Server is telling you that user has no  permissions on that database. Add that user to the database if you want to use that login.
0 Kudos
jp
by
New Contributor II
I fixed it by selecting SQL Server Native Client 10.0 instead of SQL Server.

And also had to change the server name to another server.


Thanks all for your help.
0 Kudos