We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,153 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Classic ASP Database Connection with SQL

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.

2
Contributors
3
Replies
23 Hours
Discussion Span
1 Year Ago
Last Updated
4
Views
Question
Answered
CaffeineCoder
Junior Poster in Training
58 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 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
hielo
Veteran Poster
1,131 posts since Dec 2007
Reputation Points: 116
Solved Threads: 247
Skill Endorsements: 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.

CaffeineCoder
Junior Poster in Training
58 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0
Question Answered as of 1 Year Ago by hielo

Good to go now. Gotta love bogus messages.

CaffeineCoder
Junior Poster in Training
58 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.5167 seconds using 2.67MB