Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Mismatch Problem

Status
Not open for further replies.

Buca

Programmer
Feb 16, 2002
5
0
0
GB
I have the following SQL Query
datinfo.RecordSource = "SELECT * FROM Records WHERE ID = = '" &
txtSName.Text & "'"

Records.ID is a field from a database created through the Visual Manager in
VB. This field is set to Long. I had to pick this one because it is the
only field in the Visaul DataManager that can be incremented automatically.

The field the txtID.Text is retrieving its information from through the DAO
data control is also set to long for the same reason.

How do I change the data types of either/both of these so that the query
will work?
Is this even the right approach to take?

Thank you all
 
I don't know if the "==" is a mis type but try this

datinfo.RecordSource = "SELECT * FROM Records WHERE ID = '" &
CLng(txtSName.Text) & "'"

If that does not work try it with out the single quotes

datinfo.RecordSource = "SELECT * FROM Records WHERE ID = " &
CLng(txtSName.Text)

Hope this helps

Anything is possible, the problem is I only have one lifetime.
[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top