frothytoad
Technical User
I have VB code that accesses a MySQL database, and am hoping that someone can educate me on the following issue. There are two methods that are immediately obvious to me (although I am sure there are many others, probably more clever) for updating the database. The first is to open a recordset, such as using ADO, and manipulate the data. E.g.,
Set MyRST = New ADODB.Recordset
MyRST.Source = "SELECT * FROM MyTable WHERE ..."
...
MyRST.Open
MyRST.Add
...
MyRST.Update
The second would be to send an SQL statement more directly, e.g.:
strQry = "INSERT INTO MyTable VALUES (..."
MyConn.Execute strQry
My guess is that one of these is likely to be better than the other, but I am not sure which.
Any thoughts?
Thanks,
-- Jeff
Set MyRST = New ADODB.Recordset
MyRST.Source = "SELECT * FROM MyTable WHERE ..."
...
MyRST.Open
MyRST.Add
...
MyRST.Update
The second would be to send an SQL statement more directly, e.g.:
strQry = "INSERT INTO MyTable VALUES (..."
MyConn.Execute strQry
My guess is that one of these is likely to be better than the other, but I am not sure which.
Any thoughts?
Thanks,
-- Jeff