VB高手快来看看

来源:百度知道 编辑:UC知道 时间:2024/07/06 10:45:11
Dim cn As New ADODB.Connection, rs1 As New ADODB.Recordset, sql As String, mypath As String
Dim cm As New ADODB.Command
Private Sub Command1_Click()
'Form2.Show
'Form1.Hide
Dim notfind As Boolean
notfind = True

While (rs1.EOF = False And notfind)这句有错误,咋回事
If ((rs1.Fields(0).Value = Text1.Text) And (rs1.Fields(1).Value = Text2.Text)) Then

notfind = False
Unload Me
功能菜单.Show

Else
rs1.MoveNext
End If

Wend
' rs1.Close
cn.Close
'Label3.Caption = "error"

End Sub

Private Sub Form_Load()
'cn.Open "provider=sqloledb;server=1CCF76D31E3D4E9\AUDIT;initial catalog=yygzgl;user id=sa;password=123"
mypath = App.Path & "\\test.mdb"
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mypath
sql = "select * from

估计你是想实现类似登陆界面的问题

从你的代码来看,notfind 这个变量没有什么意义,可以删除.

While (rs1.EOF = False And notfind) 改为
While not rs1.EOF

什么错误提示?这么看没什么问题啊。。可能是那个and。。
按1楼说的也没什么错,变量没什么大用。。