Home > Software engineering >  Questions about using vb6 query mysql
Questions about using vb6 query mysql

Time:11-06

On the first code
Dim yz As Integer
Dim cn As New ADODB. Connection
Dim the rs As New ADODB. You
Dim strCn As String
Dim db_host As String
Dim db_user As String
Dim db_pass As String
Dim db_data As String
Dim As SQL String
Dim un1 As String
Dim pw1 As String


Private Sub Command1_Click ()
Dim yz1 As Integer
If Text1. Text="" Then
MsgBox "please input your account"
ElseIf Text2. Text="" Then
MsgBox "please enter your password"
ElseIf Text3. Text="" Then
MsgBox "please enter the verification code"
ElseIf current_un="+ un1 +" And current_pw="+ pw1 +" Then
MsgBox "landing successful
"Form3. Show
Form1. Hide
The Else
MsgBox "your account or password incorrect"
End the If


Private Sub Form_Load ()
Db_host="XXXX" (the database connection has been successfully)
Db_user="login" (the database connection has been successfully)
Db_pass="XXXX (the database connection has been successfully)
Db_data="https://bbs.csdn.net/topics/login" (the database connection has been successfully)
StrCn="DRIVER={8.0 ANSI MySQL ODBC DRIVER};" & "SERVER=" & amp; Db_host & amp; ";" & "The DATABASE=" & amp; Db_data & amp; ";" & "UID=" & amp; Db_user & amp; "; The PWD="& amp; Db_pass & amp; ";" & "OPTION=3;" (the database connection has been successfully)
Cn. Open strCn (database connection has been successfully)

SQL="select * from the login"
Rs. The Open SQL, cn

Randomize
Z=Int (Rnd () * 10000 + 1000)
Label4. Caption="" & amp; Yz
End Sub


I want to query un1=database intermediate hurdles of the UN's data and same line pw field=pw1
The form3. Show, Form1. Hide log in successfully

CodePudding user response:

SQL="select login_name, login_password from Login_table where login_name='" & amp; Text1. Text & amp; "' and login_password=" & amp; Text2. Text & amp; "'" 'assignment

Rs. The Open SQL, rc
If the Rs. RecordCount & gt; 0 Then 'rs. Recordcount meaning for article list record for
Integrated interface. The Show
Endif
  • Related