473,701 Members | 2,728 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Q: DataAdapters and Global WildCard Searches

Okay... I'm using VB.net (2003) and I am accessing an MS Access DB file.

I have two DataAdapters that I use to search for specific info. The two of
them are similar except one is a Date, the other is a String.

Currently they both work as I like and I can get my data as I want. What I'm
intersted in is seeing HOW I do a Global search for both cases. Here are my
two issues:

ISSUE 1:
Dates... in my SELECT I search for a date using something like:

.... WHERE MyDate = ?
.... then...
daMyData.Select Command.Paramet ers(0).Value = WeekEndDate
daMyData.Fill(D sMyData.MyDataT able)

If I want to get ALL of my data regardless of the Date, I've figured out that
I can add in a 2nd Parameter (ie: most earliest date to most latest date).
Thus I get the data between the two dates.

.... WHERE MyDate BETWEEN ? and ?
.... then...
daMyData.Select Command.Paramet ers(0).Value = StartDate
daMyData.Select Command.Paramet ers(1).Value = EndDate
daMyData.Fill(D sMyData.MyDataT able)

My question is: IS this the correct way (using 2 parameters)? Or is there
some kind of Global search (ie: * ) for a Date using my original single
Parameter?
ISSUE 2:
Strings: Similar to the above, I do a search for a string:

.... WHERE MyData = ?
.... then...
daMyData.Select Command.Paramet ers(0).Value = FindData
daMyData.Fill(D sMyData.MyDataT able)

So my question is: HOW do I do a global wildcard search (ie: * ) for a String?
If this is at alll possible.

Basically the two issues are for when I want to see ALL of my data rather than
specific search criteria.

Is it just that I have to create a new DataAdapter/Set where I don't do any
WHERE statement?

Appreciate any input.

JohnT
Dec 17 '05 #1
2 1668
JohnT,

First of all, SQL for Access is much limited than for most other
databaseServers .

http://msdn.microsoft.com/library/de.../acfundsql.asp

See as well the links to the additional resources at the bottom of this
article

Although I am strugling with this one as well forever.

I my opinion do you do it very it correct and than my idea is, why not just
replace the selectString (or SP) in your commandText for one without the
WHERE clause?

That you fill than the parameters does not harm at all.

I hope this helps,

Cor

"JohnT" <Jt@MyHome.co m> schreef in bericht
news:h0******** *************** *********@4ax.c om...
Okay... I'm using VB.net (2003) and I am accessing an MS Access DB file.

I have two DataAdapters that I use to search for specific info. The two
of
them are similar except one is a Date, the other is a String.

Currently they both work as I like and I can get my data as I want. What
I'm
intersted in is seeing HOW I do a Global search for both cases. Here are
my
two issues:

ISSUE 1:
Dates... in my SELECT I search for a date using something like:

... WHERE MyDate = ?
... then...
daMyData.Select Command.Paramet ers(0).Value = WeekEndDate
daMyData.Fill(D sMyData.MyDataT able)

If I want to get ALL of my data regardless of the Date, I've figured out
that
I can add in a 2nd Parameter (ie: most earliest date to most latest date).
Thus I get the data between the two dates.

... WHERE MyDate BETWEEN ? and ?
... then...
daMyData.Select Command.Paramet ers(0).Value = StartDate
daMyData.Select Command.Paramet ers(1).Value = EndDate
daMyData.Fill(D sMyData.MyDataT able)

My question is: IS this the correct way (using 2 parameters)? Or is there
some kind of Global search (ie: * ) for a Date using my original single
Parameter?
ISSUE 2:
Strings: Similar to the above, I do a search for a string:

... WHERE MyData = ?
... then...
daMyData.Select Command.Paramet ers(0).Value = FindData
daMyData.Fill(D sMyData.MyDataT able)

So my question is: HOW do I do a global wildcard search (ie: * ) for a
String?
If this is at alll possible.

Basically the two issues are for when I want to see ALL of my data rather
than
specific search criteria.

Is it just that I have to create a new DataAdapter/Set where I don't do
any
WHERE statement?

Appreciate any input.

JohnT

Dec 17 '05 #2
>First of all, SQL for Access is much limited than for most other
databaseServer s.
Understood.
I my opinion do you do it very it correct and than my idea is, why not just
replace the selectString (or SP) in your commandText for one without the
WHERE clause?

That you fill than the parameters does not harm at all.

I hope this helps,


Thank you Sir... I'll play with it some and see where I get!

JohnT
Dec 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7428
by: Robert Brown | last post by:
I have researched newsgroups and the web very thoroughly and unsuccessfully for a solution to what I believe is a very common problem. I know it's easy to do wildcard match against data in DB (using LIKE and "%" and "?"). But is it possible to match a concrete string against a database of wildcarded data? ("%" and LIKE do not work). For example: CREATE TABLE blacklist (
1
7272
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 database field containing "somestring". Is there a way to avoid the need for the asterisks? This would make it easier for the users and also I wouldn't have to explain that asterisks are required when performing a wildcard search.
3
1388
by: JJ | last post by:
Hi All I have a DataAdapter that I create in a middle data tier. Now if I called that middle data tier class and it creates that DataAdapter that is global in that class does it persist through the life of the App Thanks J
2
1297
by: Vik | last post by:
Is it possible to loop through all dataadapters on page? Thanks
2
1992
by: MB | last post by:
Hi, I am using a datagrid and the datagrid is filled through the SQL query. The SQL query searches for the match in the database. The SQL Query that i am writing is as follows Dim selprod As String = "SELECT ProductID, ProductName FROM Products WHERE ProductName LIKE '%prod%'" but it is not working. If I use the query this way(as given below) it works but I want to use
3
2274
by: george.lengel | last post by:
Hello experts, I have been struggling for days to solve this problem and every suggestion I find via Google does not work for me. There is probably a solution out there that will do what I want, but I probably have not properly implemented the solutions I find. I am trying to make a page to allow personnel the ability to search our backend DB (which is Ingres 2.0) through a web interface. Ingres has a cgi program called ICE that can...
4
1600
by: madeleine.macphail | last post by:
I'm currently tearing my hair out on this one. I'm trying to run through a bunch of worksheets in a bunch of workbooks and only run an import on the ones that match the type of name I'm looking for. I thought it would be a simple matter of: sheetRange = xlSheet.Name If sheetRange = "AOD*" Then
21
3472
Dököll
by: Dököll | last post by:
Greetings Again, All! I know a bit more of the back end of things than front. Every now and then I use wildcard to retrieve data via sql advantage, oracle, and of course, our beloved MS Access ;-) I can't seem to find a wild card that will work in VB 6. in spl advantage Ic an ue a 'Sam%' to find all Sam(s) and '%Sam' for Sam like, Example Samuel would show up here. Is there such a thing in VB 6, recent searches and reading hve come up...
0
2668
by: savage678 | last post by:
Hi Everyone, I am new to this forum and am i dire need of some help. I am trying to use wildcard searches in infopath. I have it connected to an access database using data connection. I have some code which will allow me to do it but i dont know how to change the code. Could someone please help me. I have added the code for you to. function MyQuery::OnClick(eventObj) { // Get the default SQL command for the form. var...
0
8737
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8649
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8978
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8936
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4665
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3104
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2036
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.