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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[Microsoft][ODBC SQL Server Driver]Communication link failure

Status
Not open for further replies.

mobyshaikh

Programmer
May 19, 2002
4
AE
I am using ASP to connect to SQL7 and read data only and I get the following error.
Any help would be appreciated. Thanks!

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC SQL Server Driver]Communication link failure
 
Please show the code you are executing and your connection string.
 
Code Fails on connection time.

I have put this code in my Global.asa so that all pages should use the same connection string. Is this a good way??? If not what is a better way.
Application("oConnStr") = "DSN=TT;uid=TT;pwd=TT"
Set Application("oConn") = Server.CreateObject("ADODB.Connection")
Application("oConn").Mode = 3 '3 = adModeReadWrite
Application("oConn").Open Application("oConnStr")


Then inside asp pages i am using this:
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1 = "Select * From InNile_Members"
Sql1 = Sql1 & " where MemberID= '" & Request("RefferalID") & "'"

rs1.open sql1, Application("oConnStr"), AdopenStatic
'Counting the records matched
MemberCount = rs1.recordcount
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top