Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot connect to Database

Status
Not open for further replies.

johndayo

Programmer
May 22, 2002
11
GB
Can anyone help me. I'm having trouble connecting to my database (SQL Server), and receive the error shown below. I'm connecting to the db using a connection string which is set in the global.asa file. All the parameters for the connection are correct. Any possible solutions are welcomed even the most blindingly obvious as this is driving me mad.


Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified


Cheers
Dayo
 
Can you post your connection string so that we can see it? Matthew Wilde
matthew@ukwebsite.com
 
Application("ConnectionString") = "Provider=SQLOLEDB.1;Password=password;" & _
"Persist Security Info=True;User ID=UserID;" & _
"Initial Catalog=db_name;Data Source=server_name"
 
... and how do you open the connection?
Code:
conn.open Application("ConnectionString")

?? This is not a bug - it's an undocumented feature...
;-)
 
It seems to me like you just copied the connection string from somewhere and pasted it in there - I could be wrong though!
Is password(small letters) the password you use to connect to your database?
Is UserID your user name?
Replace db_name with the name of the table you want to connect to.
Rplace server_name with the name of the machine your database is situated on.
Something like this

Provider=SQLOLEDB.1;Password=MyBusiness;Persist Security Info=False;User ID=sa;Initial Catalog=CDResource;Data Source=TEST-2002

Hope you understand.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top