I've converted an Access 97 database to 2000 and am trying to update the Visual Basic 6 program to access the database. I originally changed the database and recordsets to DAO. The program compiled and ran fine in the development environment; but when I created the .EXE, I got the error "The memory could not be written" when I tried to run it. Debug showed this as an access violation. I didn't know what to do about this so I went back to the drawing board and changed DAO to ADODB. Depending on how I set the code up, I either get a message about a syntax error in the FROM clause or object variable not set. This is what I have right now and it produces the syntax error:
Public conn As ADODB.Connection
Public rstLoad As ADODB.Recordset
Public strSQL As String
Public LoginID As String
Set conn = New ADODB.Connection
set rstLoad = New ADODB.Recordset
conn.Open "provider=Microsoft.Jet.OLEDB.4.0;" & _
"data source=c:\variance.mdb;"
LoginID = "tmprray"
strSQL = "Select * From User Where LoginID = '" & LoginID & "'"
rstLoad.Open strSQL, conn
The last statement is where the error occurs. I'm really frustrated and would appreciate any help.
Thanks,
Rhonda
Public conn As ADODB.Connection
Public rstLoad As ADODB.Recordset
Public strSQL As String
Public LoginID As String
Set conn = New ADODB.Connection
set rstLoad = New ADODB.Recordset
conn.Open "provider=Microsoft.Jet.OLEDB.4.0;" & _
"data source=c:\variance.mdb;"
LoginID = "tmprray"
strSQL = "Select * From User Where LoginID = '" & LoginID & "'"
rstLoad.Open strSQL, conn
The last statement is where the error occurs. I'm really frustrated and would appreciate any help.
Thanks,
Rhonda