代码如下
Dim conn As ADODB.Connection
Dim strSQL As String
Dim WithEvents rs3 As ADODB.Recordset
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOk_Click()
'On Error Resume Next
rs3.Fields("Range").Value = txtInfo3.Text
rs3.Update
Unload Me
End Sub
Private Sub Form_Activate()
Call Load_Data3
End Sub
Private Sub Load_Data3()
'On Error Resume Next
Set conn = New ADODB.Connection
conn.Open "provider=Microsoft.Jet.OLEDB.4.0;" & "Data source=" + App.Path + "\rsda.mdb;" & "persist security info=false"
strSQL = "select * from usys_dict where [CField] = '" & SSTab1.TabCaption(2) & "' and [TableName] = '员工档案'"
Set rs3 = New ADODB.Recordset
rs3.CursorLocation = adUseClient
rs3.Open strSQL, conn, adOpenDynamic, adLockOptimistic 'adLockReadOnly
txtInfo3.Text = rs3.Fields("Range").Value
End Sub
红色字体出错,请问这是为什么?