can someone please tell me how i can search a mysql database, what i need is for it to search for the username and password and see if they match in the database, i am completley new to mysql, i have through a example managed to connect to the database and disaply it with this:
VB Code:
Option Explicit Private cn As New ADODB.Connection Private rs As New ADODB.Recordset Private cnString As String Private sSQL As String Private Sub cmdExecute_Click() On Error GoTo ErrHandler Dim sTable As String sTable = "phpbb_users" cnString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & "*****" & ";PORT=3306;" & _ "DATABASE=" & "*******" & ";USER=" & "888888" & ";PASSWORD=" & "*******" & _ ";OPTION=3;" cn.ConnectionString = cnString cn.Open If chkQuery.Value <> 1 Then sSQL = "Select * from " & sTable rs.Open sSQL, cn, adOpenDynamic, adLockOptimistic Set MSHFlexGrid1.Recordset = rs Set cn = Nothing Set rs = Nothing Exit Sub ErrHandler: MsgBox Err.Description, vbCritical Resume Next End Sub
i dont know if this matters but the field headings are username and user_password, any help or a point in the right direction would bre great




Reply With Quote