ADO update rs from sql

timothyl

Registered User.
Local time
Today, 03:13
Joined
Jun 4, 2009
Messages
92
Good evening, just getting my feet wet with ADO, not tired updating from sql before. Assume There is s connection then if

Dim rs As New ADODB.Recordset

SQL = "SELECT * FROM tblCustomers

ZSQL = " Stuff "

rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic

rs.Open SQL, , , ,adCmdText

Here is where i get lost. If I was updating the record souse from a text box I would do

If rsUpdate.EOF = False Then
rsUpdate.Fields.Item("field1") = Me.txtbox2.Value
rsUpdate.Fields.Item("field2") = Me.txtbox3.Value

rsUpdate.Update
rsUpdate.Close

End If

MsgBox "Record Updated"

Set rsUpdate = Nothing
Set cnn = Nothing

But what do you do if you want to update using a sql statement say ZSQL ?

Any assistance an comments are gratefully welcomed
 

Users who are viewing this thread

Back
Top Bottom