|
以下有几个错误:1、连接字符串属性无效
2、连接无法用于执行此操作,在此上下文中他可能已关闭或无效
3、数据类型不符
Private Sub Command6_Click()
Dim cn As ADODB.Connection
Dim rx As ADODB.Recordset
Dim user_online As Integer
Dim user_id As Integer
Dim user_name As String
user_online = 0
Set cn = New ADODB.Connection
cn.CursorLocation = adUseClient
cn.Open "provider=sqloledb;password=120979120979;" & _
"user_id=sa;initial catalog=accesstata;data source=wangqiang"
Set rx = New ADODB.Recordset
'On Error GoTo Err_Command6_Click
If IsNull(Text2) Or IsNull(Text4) Then
MsgBox "没有输入用户名或密码,请重新输入", vbInformation, "系统提示"
Exit Sub
End If
rx.Open "select * from user_tbl where user_name=' Text2 ' and user_password=' Text4 '", cn, adOpenStatic, adLockBatchOptimistic, adCmdText
[ 本帖最后由 dreamice01 于 2008-2-27 09:40 编辑 ] |
|