求解~做了一个有权限的数据怎么显示没有权限读取
Dim conn As New ADODB.ConnectionDim rs As New ADODB.Recordset
Dim sql As String
Dim connstr As String
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\VB数据\njzhxt.mdb;Persist Security Info=False"
sql = "select * from [njzhxt] where uesrname='" & Text1.Text & "'"
conn.CursorLocation = adUseClient
conn.connectionstring = connstr
conn.Open
rs.Open sql, conn, adOpenStatic, adLockOptimistic, 0
'Set rs = conn.Execute(sql)
'rs.Open sql, conn, adOpenStatic, adLockOptimistic
If rs.RecordCount = 0 Then
MsgBox "用户不存在"
rs.Close
conn.Close
Exit Sub
End If
If Text2.Text <> rs("password") Then
MsgBox "密码错误"
rs.Close
conn.Close
Else
rs.Close
conn.Close
form2.Show
Unload Me
End If
End Sub
Private Sub Form_Load()
Dim conn As New ADODB.Connection
Dim connectionstring As String
connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "D:\VB数据\njzhxt.mdb;Persist Security Info=False"