By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,481 Members | 3,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,481 IT Pros & Developers. It's quick & easy.

Problem selecting from database using partial string

P: 1
Hi All;

My problem is getting information from an Access database using a partial string in VB6.

The database consists of tables of information on motor vehicles including a 17 character VIN number.

To make life easier I wish to select data from the table using the last eight (rightmost) characters of the string. I have used the following select satement.

SELECT table.[year],table.[make],table.[model] .......etc from table WHERE table.[Right(vin,8)] = """& txtbox & """

When I run this the program comes to a grinding halt without an error message.

If I run the program using a full VIN number (without the right(s,8)) it runs without a hitch.

Anybody got an idea what I'm doing wrong?

Thanks
Nov 1 '06 #1
Share this Question
Share on Google+
1 Reply


scripto
100+
P: 143
Hi All;


SELECT table.[year],table.[make],table.[model] .......etc from table WHERE table.[Right(vin,8)] = """& txtbox & """

try this:

SELECT table.[year],table.[make],table.[model] .......etc from table WHERE table.vin like "*" & txtbox.text
Nov 1 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.