Dim mRst As New ADODB.Recordset mRst.CursorLocation = adUseClient mRst.Open "Select * From Table1",mCnnString,3,3 'mCnnString是你的连接字符串 Do While Not mRst.Eof mRst.Field(0) = ... mRst.Field(1) = ... ...... mRst.Move Next Loop
dim sqlstr as string dim rs as new recordset SqlStr = "从数据库中读出" Set rs = Cw_DataEnvi.DataConnect.Execute(SqlStr) do while rs.EOF Then rs.move next loop
if rs.recordcont>0 then rs.movefirst do while not rs.eof '进行操作……
Rs.move next
loop
mRst.CursorLocation = adUseClient
mRst.Open "Select * From Table1",mCnnString,3,3 'mCnnString是你的连接字符串
Do While Not mRst.Eof
mRst.Field(0) = ...
mRst.Field(1) = ...
......
mRst.Move Next
Loop
dim rs as new recordset
SqlStr = "从数据库中读出"
Set rs = Cw_DataEnvi.DataConnect.Execute(SqlStr)
do while rs.EOF Then
rs.move next
loop
rs.movefirst
do while not rs.eof
'进行操作……
rs.movenext
loop
endif