i have created a database in mysql5.0. i want to display the data from it. it has table named login. it has 2 columns username and password. in form i have 2 text fields username and password i just want to validate input with database values and display message box. connection from vb to database is established successfully. but its not validating input. its giving error as 'object required'. please any body help i'm new to vb.
i'm using vb6 and mysql5.0 thank you
code is:
public con As ADOB.connection
public rs2 As new ADOB.Recordest
public sub preconnection()
set con = New connection
set rs = New recordest
set con = New ADOB.connection
con.connectionString = "DRIVER = {Mysql ODBC 3.51 driver};"_
& "SERVER = localhost;"_
& "DATABASE = vbtest;"_
& "UID = root;"_
& "PWD = ;"
con.cursorLocation =
con.open
end sub
sql = "select *from login"
set rs = con.execute (sql)
if rs.BOF = False Then
While Not rs.EOF
If Ucase(txtlogin.text = trim(rs(0)) Ad txtpassword.text = Trim(rs(1)) Then
username = rs(0)
loginname = True
MsgBox("welcome")
End if
rs.movenext
wend
End Sub