1.11M Members

Classic ASP Database Connection with SQL

 
0
 

I'm trying to connect a SQL database to a Classic ASP site. I keep getting the following error message no matter what I do:

ADODB.Connection error '800a0e7a'

Provider cannot be found. It may not be properly installed.

I have an ODBC entry for this database, as well as have the following connection info in the file (although I've changed some of these for security b4 posting here):

Set objConn = Server.CreateObject("ADODB.Connection")

objConn.ConnectionString = "Provider={SQL Server};Server=server;Database=db;User ID=id;Pwd=pw"

strSQL = "SELECT * FROM table"

objConn.Open strSQL, objConn

Can someone please point out where I'm amiss as I've been going through Google plus a few examples for this, and am still coming up short.

 
0
 

Read comments in code:

Dim strSQL
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS   = Server.CreateObject("ADODB.Recordset")
objConn.ConnectionString = "Provider={SQL Server};Server=server;Database=db;User ID=id;Pwd=pw"

strSQL = "SELECT * FROM table"

'open connection first
objConn.open

'execute the sql on the Recordset object
objRS.Open strSQL, objConn, 1,3

If Not objRS.EOF Then
 'iterate through records here
Else
 'no records found
End If
objRS.close
Set objRS=Nothing
objConn.close
Set objConn=Nothing
 
0
 

Thanks for the response, but that doesn't resolve the error. Still getting
ADODB.Connection error '800a0e7a'

Provider cannot be found. It may not be properly installed.

Question Answered as of 3 Years Ago by hielo
 
0
 

Good to go now. Gotta love bogus messages.

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: