SQL Update In Custom Add-In

Apr 14, 2008 2 Replies

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.


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).

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:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required