在一个“成员查询”界面上要输入一个人的姓名来查询数据库中的这个人的全部信息并显示在界面上[答疑]

我做的一个VB程序,在一个“成员查询”界面上要输入一个人的姓名来查询数据库中的这个人的全部信息并显示在界面上,但是代码不会写啊 ! 我也是刚学VB,也不明白应该怎么弄,帮忙给个详细的代码!谢谢!
 
'〓〓〓〓〓〓〓〓〓〓OpenAccess函数相关定义声明等 Start
Public Conn As New ADODB.Connection
Public HidErr As Boolean
Public RS As New ADODB.Recordset
Public comm As New ADODB.Command
'〓〓〓〓〓〓〓〓〓〓OpenAccess函数相关定义声明等 End
'┏〓〓〓〓〓〓〓〓〓 OpenAccess,start 〓〓〓〓〓〓〓〓〓┓
'[详介]:
'函数注释:
'[简介]:
'打开ACCESS数据库,可设定登陆的密码
Function OpenAccess(Mdbfilepath As String, Optional Mdbpassword As String, Optional usemdw As Boolean) As Boolean
   '帮你写函数,帮你写代码,帮你写模块,帮你设计软件
   '联系QQ:1085992075--需要什么函数或功能,可以联系我。
   On Error GoTo err
   Dim ConnStr As String
   Conn.ConnectionTimeout = 999999999
   ConnStr = "Provider=MSDASQL.1;Persist Security Info=false;User ID=sa;Extended Properties=DRIVER=Microsoft Access Driver (*.mdb);"
   If usemdw Then ConnStr = ConnStr & "DBPROP_JETOLEDB_SYSDBPATH=" & Chr(34) & "F:\PROGRA~1\MICROS~2\OFFICE\SYSTEM.MDW" & Chr(34) & ";user=admin;pass=abc;"
   ConnStr = ConnStr & "DBQ=" & Mdbfilepath & ";Password=" & Mdbpassword
   Conn.open ConnStr
   OpenAccess = True
   Exit Function
   err:
   If Not HidErr Then
   
   MsgBox err.Number & vbCrLf & err.Description
   End If
End Function
'┗〓〓〓〓〓〓〓〓〓  OpenAccess,end  〓〓〓〓〓〓〓〓〓┛

Sub Test()
Dim RS As New ADODB.Recordset
'Set Rs = CreateObject("adodb.recordset")
Dim Sql As String
Sql = "select * from 表1 WHERE USER='" & "李三" & "'"
'以上用来查李三这条数据
RS.open Sql, Conn, 1, 3
MsgBox RS(0)
End Sub

Private Sub Command1_Click()
OpenAccess APP.PATH & "\1.mdb"

Test
End Sub


 

你可能感兴趣的:(数据库,microsoft,function,string,properties,access)