Hello,
I seem to be stuck and need some assistance. Trying to update or add a row to a MySQL database. Can connect and read/get data fine. Just can’t seem to push data. Have retried with this simple script, but still no go. I thought maybe I wasn’t getting write access, but result.readonly returns “False”. That means it’s “not” read only, correct?
Any suggestions on what I’m missing here would be most appreciated.
Thanks,
Erik
Sub Initialize
Dim con As New odbcconnection
Dim qry As New odbcquery
Dim result As New odbcresultset
Dim number As Integer
number = "999"
On Error Goto errorhandler
Set qry.Connection = con
Set result.Query = qry
Msgbox result.readonly
con.ConnectTo("remote_db") ' real name replaced for example purposes...
qry.SQL = "SELECT * FROM caller_table"
result.execute
'result.nextrow 'tried adding next row, but no difference
result.addrow
Call result.SetValue("TELNBR",number)
Call result.SetValue("LAST_NAME","Smith")
result.UpdateRow
result.Close(DB_CLOSE)
con.Disconnect
Exit Sub
errorhandler:
Msgbox result.getextendederrormessage,,_
result.GetErrorMessage
Exit Sub
End Sub