sladerwilson
11-16-2007, 10:22 AM
I have been looking through the posts... and reading everything I can lay my hands on, but I can't get the simplest code to work. Can someone help steer me in the right direction? I have experience in SQL and connecting databases to ASP pages but VBA is brand new to me.
I am using Access 2000.
I created a new module and copy/pasted some sample code... yet I can't get this code to run at all... I get the following error:
Run-time error '424':
Object required
When I debug it highlights the Set conn = Server.CreateObject("ADODB.Connection") line and when I hover over the conn variable it says it's empty.
Someone please point me in the right direction.
Option Compare Database
Private Sub testCode()
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection
Set rs = Server.CreateObject("ADODB.recordset")
strSQL = "SELECT * FROM export WHERE Field2 = 'C'"
rs.Open strSQL, conn, 3, 3
rs.MoveFirst
While Not rs.EOF
UPDATE CoreItemStatus = 'MFD'
rs.MoveNext
Wend
End Sub
I am using Access 2000.
I created a new module and copy/pasted some sample code... yet I can't get this code to run at all... I get the following error:
Run-time error '424':
Object required
When I debug it highlights the Set conn = Server.CreateObject("ADODB.Connection") line and when I hover over the conn variable it says it's empty.
Someone please point me in the right direction.
Option Compare Database
Private Sub testCode()
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection
Set rs = Server.CreateObject("ADODB.recordset")
strSQL = "SELECT * FROM export WHERE Field2 = 'C'"
rs.Open strSQL, conn, 3, 3
rs.MoveFirst
While Not rs.EOF
UPDATE CoreItemStatus = 'MFD'
rs.MoveNext
Wend
End Sub