日期:2014-05-17 浏览次数:22688 次
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Form1_Load()
Set cnn = New ADODB.Connection
cnn.Open "Provider=SQLOLEDB.1;Password=123;Persist Security Info=false;User ID=sa;Initial Catalog=testdatabase;Data Source=computer"
Set rs = New ADODB.Recordset
End Sub
Private Sub Timer1_Timer()
rs.open ***************
*
*
*
*
rs.close
End Sub
Private Sub Timer2_Timer()
If rs.State = adStateOpen Then
rs.Close
End If
If cnn.State = adStateOpen Then
cnn.Close
End If
Set cnn = New ADODB.Connection
cnn.Open "Provider=SQLOLEDB.1;Password=123;Persist Security Info=false;User ID=sa;Initial Catalog=testdatabase;Data Source=computer"
Set rs = New ADODB.Recordset
End Sub