Set commStudentMove = New ADODB.Command Set cnnStudentMove = New ADODB.Connection '设置连接属性 cnnStudentMove.ConnectionString = "数据库连接字符串" 'cnnStudentMove.CursorLocation = adUseServer cnnStudentMove.Open
'设置Command对象 Set commStudentMove.ActiveConnection = cnnStudentMove commStudentMove.CommandText = "select * from 表名" commStudentMove.CommandType = adCmdText Set rsStudentMove = commStudentMove.Execute rsStudentMove.Close rsStudentMove.LockType = adLockBatchOptimistic rsStudentMove.Open
Set cnnStudentMove = New ADODB.Connection
'设置连接属性
cnnStudentMove.ConnectionString = "数据库连接字符串"
'cnnStudentMove.CursorLocation = adUseServer
cnnStudentMove.Open
'设置Command对象
Set commStudentMove.ActiveConnection = cnnStudentMove
commStudentMove.CommandText = "select * from 表名"
commStudentMove.CommandType = adCmdText
Set rsStudentMove = commStudentMove.Execute
rsStudentMove.Close
rsStudentMove.LockType = adLockBatchOptimistic
rsStudentMove.Open