|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello all,
I am getting the following error message when I try to connect to my sql server (sql 2000) from our web server (windows 2003) through a odbc connection. The connection works fine from the ODBC data source administrator. Error Message: -2147467259(80004005) [DBNETLIB][ConnectionOpen([Connect()]) SQL SERVER does not exist or access denied. This is the my connection string: cnADO.ConnectionString = "Provider=SQLOLEDB;Data Source=mydata;Server=mySQL;User ID=sa;Password=mypassword;" Please help... Sherry |
|
#2
|
||||
|
||||
|
Try this:
Code:
cnADO.ConnectionString = "Provider=SQLOLEDB;Data Source=name_of_server;Initial Catalog=name_of_database;User Id=sa;Password=mypassword" |
|
#3
|
|||
|
|||
|
mehere:
I tried the connectionstring you suggested above and I got this error: run-time error: 3001. Arguments are of wrong type, are out of acceptible range or in conflict with one another. What did I do wrong? Sherry |
|
#4
|
||||
|
||||
|
That's the connection string I normally use.
ie: Code:
set Conn = Server.CreateObject("ADODB.Connection")
DSNName = "Provider=SQLOLEDB;Data Source=name_of_server;Initial Catalog=name_of_database;User Id=sa;Password=mypassword"
Conn.ConnectionString = DSNName
Conn.Open
Not sure where the issue is coming from. I've never run into a problem. Here's a link you may want to look at. http://www.connectionstrings.com/ |
|
#5
|
||||
|
||||
|
Post the whole code, error message and highlight the line the error is referring to.
|
|
#6
|
|||
|
|||
|
mehere:
I got this error message:Run-time error: 424, object required. The code: Set cnADO = Server.CreateObject("ADODB.Connection") DSNName = "Provider=SQLOLEDB;Data Source=TRSBSQL; Initial Catalog=TR_Services_MSCRM;User Id=sa;Password=dummy" cnADO.ConnectionString = DSNName cnADO.Open |
|
#7
|
||||
|
||||
|
Is the line the error message on referring to the connection string? Is your connection string on seperate lines like you're showing in the above message?
If so, try: Code:
DSNName = "Provider=SQLOLEDB;Data Source=TRSBSQL;" & _ "Initial Catalog=TR_Services_MSCRM;User Id=sa;Password=dummy" You would need to concantenate your 2 seperate lines. |
|
#8
|
|||
|
|||
|
same error.
sherry |
|
#9
|
||||
|
||||
|
How about this then:
Code:
DSNName = "Driver={SQL Server};" & _
"Server=TRSBSQL;" & _
"Database=TR_Services_MSCRM;" & _
"Uid=sa;Pwd=dummy;"
They're the only two connection strings I know. If all your names are correct, then I don't know what the problem is. |
|
#10
|
|||
|
|||
|
Try using the sql server's IP address rather than the server name.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#11
|
|||
|
|||
|
I had the same problem recently, with sql server 2000& Windows 2003 svr, got the same error message.
I went to: C:\Program Files\Microsoft SQL Server\80\Tools\Binn (Might be different on your install) and opened the SQL Server Network Utility (SVRNETCN) and made sure I enabled a connection protocol. I opened TCP/IP For some reason on my machine, all the connection protocols had been deleted. Good Luck. Quote:
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > ado connectionstring to sql 2000 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|