Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with MySql AGAIN...

Status
Not open for further replies.

devilman0

IS-IT--Management
Nov 14, 2002
257
US
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.

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(&quot;Main&quot;, &quot;Path&quot;, App.Path & &quot;\Settings.ini&quot;)
Call Main(App.Path & &quot;\JobIformation.mdb&quot;)
End If
StrSql = &quot;Select * From &quot; & TableName & &quot; Where &quot; & ColName & &quot;=&quot; & 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) & &quot;-&quot; & tempInt & &quot;-&quot; & StrSql

RecordSet(tempInt) = (TempArry(i))
Next i
RecordSet.Update
RecordSet.Close
Set RecordSet = Nothing
Exit Function
ErrOccured:
Call ErrorTracking(&quot;UpdateInfo&quot;, CStr(Err.Number), Err.Description, 3, &quot;TableName: &quot; & TableName & &quot;  InfoToWrite: &quot; & InfoToWrite & &quot;  ColName: &quot; & ColName & &quot;  RowId: &quot; & RowId & &quot;  ArrayColNames: &quot; & ArrayColNames)
End Function

error i get when i try to do an update is:
code: &quot;-2147217887&quot;
Description: &quot;Multiple-step operation generated errors. Check each status value.&quot;

funny thing is, this doesn't do this when i write to an access database (2k)
any takers?


Thanks,
James
[afro][mad]
&quot;Make it idiot-proof and someone will make a better idiot.&quot; ~bumper sticker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top