Guys i need your help with this problem.

I want to check if a record in my database is available or not?

My database is stored in microsoft access file. ok.
I used the data control that comes in the default tool box and i set up the databasename property of the data control to the directry of the (.mdb) file. Then i tried to test the connection using simple SQL query. The main problem now is how to check if a record is in my database i tried this method
data1.Recordset.FindFirst "ColumnName=value). But this works only with values not with variables that means if i want to check if a user entered valid username for example in a text box how can pass this text as argument

I tried this statment but did not work it display error messagen

Data1.RecordSet.FindFirst "Column1=Text1.text"

Any help?

Recommended Answers

All 4 Replies

Data1.RecordSet.FindFirst "Column1='" & Text1.text & "'"

But Bro. The data Type of Column1 in my database is Long integer but Text1.text is String type no match!!!??

I tried to convert like this
Data1.Recordset.FindFirst "UserBadge='" & CLng(Text1.Text) & "'"

But i hade an Error No matching Type??

how to solve this?

Just ditch the single quotes if its an integer.

Data1.RecordSet.FindFirst "Column1=" & Text1.text

Thanx Bro. Good work

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.