0
votes

Can anyone explain why this works

Conn.Open "Provider=SQLOLEDB;Server=tcp:myazurename.database.windows.net;Database=People;Uid=MyUid;Pwd=MyPwd;Encrypt=yes;"

and this doesn't

Conn.Open "Provider=SQLOLEDB;Server=(localdb)\v11.0;Database=People;Uid=MyUid;Pwd=MyPwd;Encrypt=yes;"

I copied my live azure database locally for dev work in Classic ASP and the error message is

Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).] SQL Server does not exist or access denied.

Azure SQL server version: 11.0.9231 Local SQL server version: 11.0.2318

I can connect using the same details on SQL Server Management Studio so its not a user permissions thing...

Under Security for the server, the user has public server role, the user mapping for the 'People' database is everything except db_denydatareader and db_denydatawriter.

I have also tried (localdb)\\v11.0 which doesn't make a difference.

Any ideas?

1
(localdb)\v11.0 doesn't look like a Server / Local Machine name, are you sure that is your instance? Would expect something like MACHINENAME\INSTANCENAME if it's SQL Server Express it would be MACHINENAME\SQLEXPRESS.user692942
Aw..your using a localDB Automatic instance, that might be the problem. "The first connection to LocalDB will create and start the instance, this takes some time and might cause a connection timeout failure. If this happens, wait a bit and connect again." I don't think it's supported by ADODB, in effect it tries to create a new database instance for you.user692942
In fact your not likely to see any usage of SQLOLEDB especially for SQL Server 2012, you should be using the SQL Server Native Client. See SQL Server Native Client 11.0 OLE DB Provider connection strings.user692942
What are you installing? Just need to change the connection string to one of from the link I sent you and use the correctly formed Server attribute. If you have already install SQL Server Express the default instance is named SQLEXPRESS other wise it's a non express version of SQL Server then it will install a default instance against the machine, so just use MACHINENAME.user692942
OK so I believe the answer is as follows: It doesn't like (LocalDb)\V11.0 it wants a proper instance name like you said in the first place. MACHINENAME\INSTANCENAME OR localhost\INSTANCENAME which I am using as this is going to be replicated for other devs. Also, you DONT NEED two back slashes! My problem is I somehow didn't have a local instance installed. Thanks or your help @LankymartAndrew

1 Answers

0
votes

OK so I believe the answer is as follows: It doesn't like (LocalDb)\V11.0 it wants a proper instance name like you said in the first place. MACHINENAME\INSTANCENAME OR localhost\INSTANCENAME which I am using as this is going to be replicated for other devs. Also, you DONT NEED two back slashes! My problem is I somehow didn't have a local instance installed. Thanks or your help @Lankymart