old DAO project

User avatar
sal21
PlatinumLounger
Posts: 4355
Joined: 26 Apr 2010, 17:36

old DAO project

Post by sal21 »

With DAO i use to update a record fields:

rs.edit

!rs="ghg"
ecc...

but exists a similar method with ADO?

why?

i need to update 128 fields in the same time?

I know only a way in ADO:
sql="update table1 set ....

But with 128 fields is impossible to create a sql!

User avatar
HansV
Administrator
Posts: 78483
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: old DAO project

Post by HansV »

In ADODB, you don't even need to use the Edit method. If you have opened a recordset object with the correct settings, you can immediately start assigning values to fields. So for example:

Code: Select all

    Set rs = New ADODB.Recordset
    rs.Open Source:=strSQL, ActiveConnection:=cn, CursorType:=adOpenDynamic, LockType:=adLockOptimistic, Options:=adCmdText
    rs!Field1 = 37
    rs!Field2 = "Sal21"
    rs.Update
Best wishes,
Hans