sahrul Level: Guest

|
working with database in VB Archived to Disk
Hi,
I face some problem during connecting my project with databse. The formula is as below:-
Private Sub cmdFindEmployee_Click()
passno = Text4.Text
Set db = CreateObject("ADODB.Connection")
db.Open "database1"
arahanSQL = "SELECT * FROM dataA WHERE PassNo = ' " + passno + " ' "
Set rs = db.Execute(arahanSQL)
If rs.EOF Then
MsgBox "Data is not in the system!!", vbExclamation + vbOKOnly, "FIND"
Text4.Text = ""
Text4.SetFocus
Else
dbname = rs("Name")
dbbasic = rs("Basic")
Text1.Text = dbname
txtBasicSalary.Text = Format(dbbasic, AMOUNT)
db.Close
Text1.BackColor = &HC0FFFF
End If
End Sub
but when I run it message "ODBC data connection mismatch in criteria expression".
what is the problem actually?
[Edited by admin on 18-07-2002 at 08:24 AM GMT]
|