F
Fiete
I would like save logged-in-userdata, via ODBC in a external MySQL database
in the LoggedUser table. So, I create a recordset with ODBC parameters.
If the programm execute the ADddNew command, a message appears, that the
database or the object ist writeprotected. But if the table are linking with
the same ODBC Datasource, it is possible to adding records. For understanding
I've append the code:
Public Sub UserReg()
Dim wsp_stnd As Workspace
Dim dbs As Database, db As Database
Dim rst As Recordset, rs As Recordset
Dim Str01 As String
Dim I As Long
Set wsp_stnd = DBEngine.Workspaces(0)
Set dbs = wsp_stnd.OpenDatabase("Massnahme", dbDriverPrompt, False, _
"ODBC;DATABASE=Massnahme;DSN=Massnahme")
Set rst = dbs.OpenRecordset("LoggedUsers")
Set db = CurrentDb
Set rs = db.OpenRecordset("LoggedUser")
rst.AddNew '<-- Here appears the message that the DB is writeprotected
For I = 0 To 6
rst(I) = rs(I)
Next I
rst.Update
dbs.Close
wsp_stnd.Close
Set dbs = Nothing
End Sub '
Thanks, so far.
in the LoggedUser table. So, I create a recordset with ODBC parameters.
If the programm execute the ADddNew command, a message appears, that the
database or the object ist writeprotected. But if the table are linking with
the same ODBC Datasource, it is possible to adding records. For understanding
I've append the code:
Public Sub UserReg()
Dim wsp_stnd As Workspace
Dim dbs As Database, db As Database
Dim rst As Recordset, rs As Recordset
Dim Str01 As String
Dim I As Long
Set wsp_stnd = DBEngine.Workspaces(0)
Set dbs = wsp_stnd.OpenDatabase("Massnahme", dbDriverPrompt, False, _
"ODBC;DATABASE=Massnahme;DSN=Massnahme")
Set rst = dbs.OpenRecordset("LoggedUsers")
Set db = CurrentDb
Set rs = db.OpenRecordset("LoggedUser")
rst.AddNew '<-- Here appears the message that the DB is writeprotected
For I = 0 To 6
rst(I) = rs(I)
Next I
rst.Update
dbs.Close
wsp_stnd.Close
Set dbs = Nothing
End Sub '
Thanks, so far.