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

Still having trouble connecting to access

Status
Not open for further replies.

csiwa28

Programmer
Apr 12, 2001
177
I am getting

Microsoft VBScript runtime error '800a01a8'

Object required: ''

and this is happening on the last line. I don't have option explicit, so I know I don't have to worry about defining variables.


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

MdbFilePath = Server.MapPath("\amca\products\AMCA.mdb")

oConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"

SQL_query = "SELECT crpProductType_Name FROM crpProductTypes"

Set oRS = MyConn.Execute(SQL_query)


 
Here's the way I do it. The only difference I can see is that I reference a pre-exissting ODBC DSN called test.

<%

Option Explicit


Dim cnnDB, strQuery, rsInfo

'Create an instance of the Connection object.
Set cnnDB = Server.CreateObject(&quot;ADODB.Connection&quot;)

'And open it.
cnnDB.Open &quot;Test&quot;

'Build our SQL query string.
strQuery = &quot;SELECT File,Namez,FileSize,LAstMod FROM tblDocumentIndex Where File Not Like 'c:\%' ORDER BY File&quot;

'Execute the query and return a recordset.
Set rsInfo = cnnDB.Execute(strQuery)

%>
 
Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)

Set oRS = MyConn.Execute(SQL_query)

Hmmmm...Where did MyConn come from? ;-) Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top