473,320 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Can I use whitespace to add new wildcard?

Hello,

I am working on a web page that queries a microsoft access database for our library using wildcards, I have set up the queries using the CONTAINS expression, like so
Expand|Select|Wrap|Line Numbers
  1.                 '"Select Command" Value part 1
  2.                 Dim SelStat As String = "SELECT [Full Title] AS Full_Title, [Author List] AS Author_List, [Title Call Number] AS Title_Call_Number, [Series] AS Series, [Location] AS Location FROM [Library]"
  3.                 '"Select Command" Value part 2
  4.                 Dim Where As String = " WHERE"
  5.                 '(Part 3 is set further below)
  6.                 '"Select Command" Value part 4
  7.                 Dim Order As String = "ORDER BY [Title Call Number]"
  8. '...
  9.  whereStatement = " CONTAINS (([Full Title], '%' + ? + '%')"
  10.  
My problem is that the CONTAINS statement acts no differently than the LIKE statement in that the words have to be in order to include spaces and commas.
What I want to do is make it so that multiple words in the same text box will create new wildcards in my SQL statement
(eg. text box= "word1 word2 word3" will translate into SQL as
Expand|Select|Wrap|Line Numbers
  1.  whereStatement = " CONTAINS (([Full Title], 'word1' AND 'word2', AND 'word3')"
  2.  
using the space between the words to separate variables rather than read as a separate character.

Any help would be much appriciated.
Nov 15 '10 #1
3 1971
orangeCat
83 64KB
What do your Access database tables look like? ie What is the Structure?
I have not seen the CONTAINS in Access SQL. Are you sure it is available?
Nov 16 '10 #2
colintis
255 100+
orangeCat is right, there's no CONTAINS function in Access. The way to work around is using LIKE function.
Expand|Select|Wrap|Line Numbers
  1. whereStatement = _
  2. "[Full Title] LIKE '*Word1*'
  3. AND [Full Title] LIKE '*Word2*'
  4. AND [Full Title] LIKE '*Word3*'"
Nov 16 '10 #3
orangeCat is correct the contains statement isn't available in MS Access however the data tables and queries are being set up in MS Visual Studios 2010 (more specifically I'm using VB to dynamically change them.) and are using Access for the information only. I have the CONTAINS statements set up and they do work, but without further defining them they act the same way as the LIKE statement does.

For clarification: I am not looking for the type of statement necessarily. What I would like to know how to do is code my page so that wherever a user hits the space bar or uses a comma in the textbox to search, the page will treat the next word as a separate parameter rather than one full string.
Nov 16 '10 #4

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

Similar topics

1
by: Generic Usenet Account | last post by:
Here's the requirement that I am trying to satisfy: Handle wildcards in STL such that the wildcard entry is encountered before non-wildcard entries while traversing containers like sets and...
1
by: deko | last post by:
I have a form where users can enter a string with asterisks to perform a wildcard search. Currently, the string entered by the user looks like this: *somestring* The purpose is to match any...
3
by: Adam | last post by:
Its my understanding that in asp.net 2.0 you can write an httpmodule that will acts as a wildcard handler and pass requests on to the proper engine, for instance, asp or perl for example, In the...
2
by: Ken Yee | last post by:
First a little background: I've written an httphandler to handle wildcard extensions (i.e., I want to handle all URLs that come in rather than just URLs w/ a specific file extension so I can give...
7
by: SlimFlem | last post by:
I have searched hard for 2 days on this and keep hitting a wall. I have a custom IHttpHandler setup to do Url mappings to prop up some old Urls for our site. I have also created a wildcard...
2
by: Jan Kucera | last post by:
Hi, I have virtual MyFolder/* and MyFolder/MySubFolder/* mapped to an httphandler in the web.config file and all works perfectly on the asp.net development server. However on the IIS6/Win2003 I'm...
2
by: guoqi zheng | last post by:
Dear Sir, I would like all files on my application to pass asp.net, so I added aspnet_isapi.dll to the Wildcard application maps. After that, many things changed. I used to be able to visit my...
0
by: Thomas | last post by:
in .net 1.1 we successfully use a HttpModule to catch 404 / 403.1 html errors. after migrating to .net 2.0, this modules is broken in a very, very strange way. we have defined a wildcard...
6
by: Jan Kucera | last post by:
Hi, does anybody know about wildcard mapping ASP.NET 2 in IIS6? Any tutorial? Thanks, Jan
1
by: Lucvdv | last post by:
In my assembly.vb files, I'm using the revision/build wildcard style: <Assembly: AssemblyVersion("3.0.*")> <Assembly: AssemblyFileVersion("3.0.*")> This onkly seems to work in projects that...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.