I am using MySql as a DB Backend, while i can read no problem, i am having trouble writing. I can sometimes write, and sometimes no. Here's my code.
error i get when i try to do an update is:
code: "-2147217887"
Description: "Multiple-step operation generated errors. Check each status value."
funny thing is, this doesn't do this when i write to an access database (2k)
any takers?
Thanks,
James
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
![[mad] [mad] [mad]](/data/assets/smilies/mad.gif)
"Make it idiot-proof and someone will make a better idiot." ~bumper sticker
Code:
Public Function UpdateInfo(ByVal TableName As String, InfoToWrite As String, ColName As String, RowId As String, ArrayColNames As String) As String
Dim RecordSet As New ADODB.RecordSet
Dim i As Integer
Dim StrSql As String
Dim TempArry() As String
Dim TempArryB() As String
Dim tempInt As Integer
On Error GoTo ErrOccured:
If DBConnection.State <> adStateOpen Then
Path = ReadIni("Main", "Path", App.Path & "\Settings.ini")
Call Main(App.Path & "\JobIformation.mdb")
End If
StrSql = "Select * From " & TableName & " Where " & ColName & "=" & RowId
RecordSet.ActiveConnection = DBConnection
RecordSet.CursorLocation = adUseClient
RecordSet.CursorType = adOpenDynamic
RecordSet.LockType = adLockPessimistic
RecordSet.Open StrSql
TempArry = Split(InfoToWrite, Chr(9), -1, vbBinaryCompare)
TempArryB = Split(ArrayColNames, Chr(9), -1, vbBinaryCompare)
For i = 0 To UBound(TempArryB) - 1
tempInt = Int(TempArryB(i))
Debug.Print TempArry(i) & "-" & tempInt & "-" & StrSql
RecordSet(tempInt) = (TempArry(i))
Next i
RecordSet.Update
RecordSet.Close
Set RecordSet = Nothing
Exit Function
ErrOccured:
Call ErrorTracking("UpdateInfo", CStr(Err.Number), Err.Description, 3, "TableName: " & TableName & " InfoToWrite: " & InfoToWrite & " ColName: " & ColName & " RowId: " & RowId & " ArrayColNames: " & ArrayColNames)
End Function
error i get when i try to do an update is:
code: "-2147217887"
Description: "Multiple-step operation generated errors. Check each status value."
funny thing is, this doesn't do this when i write to an access database (2k)
any takers?
Thanks,
James
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
![[mad] [mad] [mad]](/data/assets/smilies/mad.gif)
"Make it idiot-proof and someone will make a better idiot." ~bumper sticker