mobyshaikh
Programmer
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
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