Home > Software engineering >  Could you tell me rs. Open SQLSTR, con, 1, 3 how to obtain updated several database records?
Could you tell me rs. Open SQLSTR, con, 1, 3 how to obtain updated several database records?

Time:09-15

Rs. The Open SQLSTR, con, 1, 3

SQLSTR is an update SQL statement


I want to know, updated a few records the total? Could you tell me how to write the great god the?

CodePudding user response:

The execute method can use the connection object:
 
Set the conn=createobject (" adodb. Connection ")
Conn. Open the Provider="Microsoft. Jet. The OLEDB. 4.0; Data Source=C: \ Documents and Settings \ Administrator \ \ Database2 desktop MDB;"
Conn. Execute "update table 1 set a=3 where a=3", recordaffected, 1
Msgbox recordaffected

CodePudding user response:

If they are used, can also use the "select @ @ rowcount" return on operations affect the number of rows.

CodePudding user response:

Con. The execute SQLSTR, recordaffected, including recordaffected is to update the number of rows

CodePudding user response:

Rs. The Open SQLSTR, con, 1, 3 in the back of the 1, 3 is the database cursor Settings, if it is 1, 3 can't modify the record, is because the cursor record, does not allow changes, general modified or new cursor Settings must be in 3, 2,

CodePudding user response:

reference 4 floor ZHRXJR response:
rs. Open SQLSTR, con, 1, 3 in the back of the 1, 3 is the database cursor Settings, if it is 1, 3 can't modify the record, is because the cursor record, does not allow changes, general modified or new cursor Settings must be in 3, 2,


Rs. The Open SQLSTR, con, 1, 3 also can change the database well, 1, 1 is read-only,