gxpark
Aug 1st, 2000, 07:16 PM
Here I am again...
I'm using ADO 2.5 with VB6, and after I succesfully open a database and fill a collection with a table recordsets, it appears I can't add new recordsets...
I open it like this (snippet from a function I wrote):
mdbConn.Mode = adModeReadWrite Or adModeShareDenyNone
mdbConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Filename & ";User ID=" & UserName & ";Password=" & Password & ";"
If mdbConn.State <> adStateOpen Then
OpenDatabase = Not OpenDatabaseResult.Success
Exit Function
End If
Set mdbRS = mdbConn.Execute("SELECT * FROM Employees")
... then some code to store the records on a collection of custom class modules...
and then, when I add a new item to the collection, the collection is supposed to add it automatically to the database, but when I issue the AddNew method (from the collection class module), I get the following error:
Run-time error '3251'
The object or provider can't execute the requested action.
I translated the message from spanish, so it may actually be slightly different.
What I'm doing wrong?
thanks!
I'm using ADO 2.5 with VB6, and after I succesfully open a database and fill a collection with a table recordsets, it appears I can't add new recordsets...
I open it like this (snippet from a function I wrote):
mdbConn.Mode = adModeReadWrite Or adModeShareDenyNone
mdbConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Filename & ";User ID=" & UserName & ";Password=" & Password & ";"
If mdbConn.State <> adStateOpen Then
OpenDatabase = Not OpenDatabaseResult.Success
Exit Function
End If
Set mdbRS = mdbConn.Execute("SELECT * FROM Employees")
... then some code to store the records on a collection of custom class modules...
and then, when I add a new item to the collection, the collection is supposed to add it automatically to the database, but when I issue the AddNew method (from the collection class module), I get the following error:
Run-time error '3251'
The object or provider can't execute the requested action.
I translated the message from spanish, so it may actually be slightly different.
What I'm doing wrong?
thanks!