Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Traduce ADO to DAO

Status
Not open for further replies.

Palmero

Technical User
Mar 31, 2001
53
FR
Hi all,

THIS IS A SAMPLE CODE USING ADO WITH ACCESS 97.
I WANT TO USE THE SAME CODE WITH DAO.
HOW TO WRITE THE CODE :

Dim Conn as connection, Rs1 as recordset, Rs2 as recordset
Set Conn = new Connection
Conn.Open YourConnectionString
Set Rs2 = new recordset
Rs2.open "t2", YourConn, adOpenKeyset, adLockOptimistic, adCmdTable
Set Rs1 = new recordset
Rs1.open "select code,libelle from t1"
If not R1.eof and not Rs1.bof then
Rs1.movefirst
while not rs1.EOF
Rs2.addnew array("code","libelle"),array("'" & NewCode & "'","'" & NewLibelle & "'")
rs1.MoveNext
wend
Rs2.update
else
msgbox "No entries to process"
end if
rs1.Close
set Rs1 = nothing
Rs2.close
Set Rs2= nothing

Thanks in advance for your answer.

Palmero.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top