SQL Update In Custom Add-In

So I've been trying to understand how to interface with the Database through an add-in I've been working on. What I need is to be able to query the database, and change a value or two. I need to be able to do this in code. I am working with vb6. I have figured out how to view DB entries by getting the recordset.

i.e. recordSet = Session.OpenRecordset(Query,readonly)

But I cant seem to figure out how to update it. I have tried changing the values

i.e. recordSet.Fields("Status").Value = "In"

and then "updating" the recordset.

i.e. recordSet.update

but that doesn't seem to do anything.

Ive also tried running and UPDATE query, when I use OpenRecordset, but I get and error.

If anybody can tell me how I can change values and update the database in code, that would be Very Much Appreciated.

Reply to
Fernando Chorney
Loading thread data ...

First of all you have opened the recordset as readonly so you will not be able to update.

dbReadOnly - Prevents users from making changes to the Recordset (default for ODBCDirect workspaces).

Reply to
Michael

sorry, you misinterpreted what I had typed, or moreso I typed it incorrectly. I was just showing the method I used. My actual call is more like this

recordSet = Session.OpenRecordset("SELECT * FROM CartTrack WHERE CartNumber=1",false)

Michael wrote:

Reply to
Fernando Chorney

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.