标题: (已解决)这种数据的连接是怎么写来着,怎么老报错?说什么连接字符串属性无效 [打印本页] 作者: dreamice01 时间: 2008-2-3 15:22 标题: (已解决)这种数据的连接是怎么写来着,怎么老报错?说什么连接字符串属性无效 Public Function GetNewConnection() As ADODB.Connection
Dim oCn As New ADODB.Connection
Dim sCnStr As String
If oCn.State = adStateOpen Then
Set GetNewConnection = oCn
End If
End Function
Private Sub Command6_Click()
Dim cn As New 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 = GetNewConnection
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 & "'")