Connection string in with sqlserver 2005
-
Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is
Public DBConn As ADODB.Connection
DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
DBConn.Open DBConn.ConnectionStringPlease suggest Thank you.
-
Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is
Public DBConn As ADODB.Connection
DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
DBConn.Open DBConn.ConnectionStringPlease suggest Thank you.
-
Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is
Public DBConn As ADODB.Connection
DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
DBConn.Open DBConn.ConnectionStringPlease suggest Thank you.
-
Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is
Public DBConn As ADODB.Connection
DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
DBConn.Open DBConn.ConnectionStringPlease suggest Thank you.
You cannot use a database file on the local machine when connecting to a remote SQL Server instance. You have to switch to a non-user-instance config string and permanently attach the database file on the remote machine to the SQL Server instance on the remote machine. This is easiesst done using the SQL Server Management tool. Then you can change the Initial Catalog option in your connection string to the database name you assign on the SQL Server. If you're going to be using Integrated Security, do not supply a username and password. If you have to supply a username and password, do not use Integrated Security. The two options are mutually exclusive.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is
Public DBConn As ADODB.Connection
DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
DBConn.Open DBConn.ConnectionStringPlease suggest Thank you.
Looks like you have posted this question multiple times There are so many reasons for this error. This bunch has the solution(s), check it. Steps to troubleshoot SQL connectivity issues[^] SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^] BTW I gave you this bunch also for future errors.
thatraja
**My Tip/Tricks
My Dad had a Heart Attack on this day so don't...
** -
You cannot use a database file on the local machine when connecting to a remote SQL Server instance. You have to switch to a non-user-instance config string and permanently attach the database file on the remote machine to the SQL Server instance on the remote machine. This is easiesst done using the SQL Server Management tool. Then you can change the Initial Catalog option in your connection string to the database name you assign on the SQL Server. If you're going to be using Integrated Security, do not supply a username and password. If you have to supply a username and password, do not use Integrated Security. The two options are mutually exclusive.
A guide to posting questions on CodeProject[^]
Dave KreskowiakHello, I changed my connection string to
DBConn.ConnectionString = "Provider=SQLNCLI;AttachDBFileName=" & App.Path & "\newdb.mdf;Database=newdb;User Instance=true;Trusted_connection=Yes;"
but it gives me run time error like Invalid connection string attribute.. Can you please suggest which attribute is invalid. Thank You.
modified on Sunday, July 31, 2011 12:28 PM
-
Looks like you have posted this question multiple times There are so many reasons for this error. This bunch has the solution(s), check it. Steps to troubleshoot SQL connectivity issues[^] SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^] BTW I gave you this bunch also for future errors.
thatraja
**My Tip/Tricks
My Dad had a Heart Attack on this day so don't...
** -
Hello, I changed my connection string to
DBConn.ConnectionString = "Provider=SQLNCLI;AttachDBFileName=" & App.Path & "\newdb.mdf;Database=newdb;User Instance=true;Trusted_connection=Yes;"
but it gives me run time error like Invalid connection string attribute.. Can you please suggest which attribute is invalid. Thank You.
modified on Sunday, July 31, 2011 12:28 PM
How many times have you asked this question? You don't have a clue what you're doing, do you? You haven't understood any of the things I said in my other post and know nothing of what's in the connection string. Your "second" attempt you posted contains none of the fixes I told you about and you're still trying to attach a remote instance of SQL Server to a local file, which will not work. http://www.connectionstrings.com[^]
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
thatraja wrote:
Looks like you have posted this question multiple times
And you still keep answering him each time?