小第想用VB编程把不同组的数据写入数据库不同的表中,部分程序如下,但不行,请问我这段程序错在那了????谢谢!
Private myrs As New ADODB.Recordset
Private mycon As New ADODB.Connection
Dim strConn As String
If st = "59280" Then
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\shujuku.mdb;Persist Security Info=False"
mycon.CursorLocation = adUseClient
mycon.Open strConn
myrs.Open "Select * from qywd", mycon, adOpenKeyset, adLockOptimistic
Set DataGrid1.DataSource = myrs
ElseIf st = "59087" Then
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\shujuku.mdb;Persist Security Info=False"
mycon.CursorLocation = adUseClient
mycon.Open strConn
myrs.Open "Select * from fgwd", mycon, adOpenKeyset, adLockOptimistic
Set DataGrid1.DataSource = myrs
End If