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

Communication Link Failure

Status
Not open for further replies.

mobyshaikh

Programmer
Joined
May 19, 2002
Messages
4
Location
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

Code Fails on connection time. And when i test the ODBC from administrative tools ... it connects fine

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