can anyone tell me what had went wrong ? my database not working thank you =)
VB Code:
Dim SQL2 As String Dim strLine As String, strFullPath As String Dim ff As Integer, iCount As Integer Dim conn2 As ADODB.Connection Set conn2 = New ADODB.Connection Dim rs2 As ADODB.Recordset Set rs2 = New ADODB.Recordset conn2.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _ "Server=localhost;" & _ "Port=3306;" & _ "Option=131072;" & _ "Stmt=;" & _ "Database=rach2;" & _ "Uid=eugene;" & _ "Pwd=rant;" ff = FreeFile x = 0 Open myfile For Input As #ff txtHaha.Text = vbNullString Do While Not EOF(ff) Line Input #ff, strLine strLine = "1310" + strLine 'inside my txt files will have numbers 131094567485 etc SQL2 = "SELECT callerId, callDate, callTime FROM call_dc WHERE DATE_SUB(CURDATE(),INTERVAL 3 DAY) <= callDate AND callerId = " + strLine rs2.CursorLocation = adUseClient rs2.Open SQL2, conn2, adOpenForwardOnly, adLockReadOnly Do While Not rs2.EOF 'if database number = txt number then it will list out in the text box where txtHaha is If rs2.Fields("callerId") = strLine Then txtHaha.Text = strLine x = x + 1 End If rs2.MoveNext Loop Loop Close #ff MsgBox x MsgBox ("Section Complete Please Open Another File")




Reply With Quote