954,558 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to check my database

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?

lover99509
Newbie Poster
21 posts since Jul 2006
Reputation Points: 15
Solved Threads: 1
 
Data1.RecordSet.FindFirst "Column1='" & Text1.text & "'"
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
 

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?

lover99509
Newbie Poster
21 posts since Jul 2006
Reputation Points: 15
Solved Threads: 1
 

Just ditch the single quotes if its an integer.

Data1.RecordSet.FindFirst "Column1=" & Text1.text
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
 

Thanx Bro. Good work

lover99509
Newbie Poster
21 posts since Jul 2006
Reputation Points: 15
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You