WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-01-2008, 03:43 PM
classic.certs classic.certs is offline
WebProWorld New Member
 

Join Date: Feb 2008
Posts: 1
classic.certs RepRank 0
Default query in Access with a where block of: Model Like "*470*"

I set up a query in Access with a where block of: Model Like "*470*". It runs successfully. I embedded the same code in a web page and it does not pull any data. It works if the asterisks are removed and the full model number is typed. Does anyone know of any quirks using the asterisk with Access when embedding it on a web page?
Reply With Quote
  #2 (permalink)  
Old 04-01-2008, 03:47 PM
kgun's Avatar
kgun kgun is online now
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 4,106
kgun RepRank 2kgun RepRank 2
Default Re: query in Access with a where block of: Model Like "*470*"

  1. Import the table to MySQL.
  2. Using embedded SQL in Visual Basic for Applications (VBA). If you can not do it in SQL, you should be able to program it in VBA?
  3. Have you looked at your SQL code? Diificult to give an answer without seeing that code.
Reply With Quote
  #3 (permalink)  
Old 04-01-2008, 04:07 PM
Dubbya's Avatar
Dubbya Dubbya is online now
WebProWorld 1,000+ Club
 

Join Date: Nov 2006
Location: Steinbach, Manitoba, Canada
Posts: 1,017
Dubbya RepRank 3Dubbya RepRank 3
Default Re: query in Access with a where block of: Model Like "*470*"

The Asterisk is also used to signify multiplication, so that could be a likely explanation for the trouble you're having.

Without the asterisks it should work.

If the string you're looking for actually contains the asterisk, you can try to convert the characters in the string and search that way.

1) Model LIKE "470" (without asterisks)
2) Model LIKE " & cStr("*470*") & " (whatever the rest of your search string consists of)
__________________
Printer ink, inkjet & toner cartridges in Canada
"Price-wise printing supplies"
inkjetOasis.ca
Reply With Quote
  #4 (permalink)  
Old 04-04-2008, 11:17 PM
John Redfield John Redfield is offline
WebProWorld Member
 

Join Date: Jun 2006
Location: Third Stone from the Sun
Posts: 25
John Redfield RepRank 0
Default Re: query in Access with a where block of: Model Like "*470*"

Are you passing the query using ASP?

If so the wild card is %

Can you share your code?

John
__________________
Peace
Reply With Quote
  #5 (permalink)  
Old 04-05-2008, 10:13 AM
MursPlace MursPlace is offline
WebProWorld Member
 

Join Date: Jan 2008
Posts: 25
MursPlace RepRank 1
Default Re: query in Access with a where block of: Model Like "*470*"

Quote:
Originally Posted by John Redfield View Post
Are you passing the query using ASP?

If so the wild card is %

Can you share your code?

John
Like John Said the wild card symbol is the percent % sign.

We have to guess you are using an IIS server with your access db.

3 basic search setup lines using LIKE statements.

1. Searching for a part number knowing first few characters.
" WHERE [table.name] LIKE '"& KeyWord &"%' "
The above says to check the letters entered and anything else that might be missing. Part Number 92 will return all parts starting with 92.

2. Searching for a part number knowing ending number or characters.
" WHERE Table.PartNumber LIKE '%"& PartNumber &"' "

3. Searching for word or words within text or numbers within text.
" WHERE [table.name] LIKE '%"& KeyWord &"%' "

That should do it for your LIKE search setup.

BUT:
Quote:
does not pull any data
You need to post your connection string as well (no username or passwords please)
Because from what you wrote your page might not even know it has data to work with!

It's always best to post what you coded so we can quickly fix it for you. Just change table names because you don't want to share your table structure with the world.
Good Luck

Last edited by MursPlace : 04-05-2008 at 10:18 AM.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
When does "similar" = "duplicate content" for Google? zwickes Google Discussion Forum 4 05-31-2007 10:57 AM
MS Access "Numeric Field Overflow" Error richkoi Database Discussion Forum 1 01-13-2005 06:41 PM
Women prefer "Gift Cards" to "Gifts". greeneagle Marketing Strategies Discussion Forum 0 12-11-2004 06:59 AM
"Domain Game" before a "Hosting" forum? greeneagle WebProWorld: Guidelines/Announcements/Suggestions 3 06-02-2004 03:57 PM
Parameter Query "HELP" pete61uk Database Discussion Forum 8 12-17-2003 05:29 AM


Search Engine Friendly URLs by vBSEO 3.0.0