473,748 Members | 5,230 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 1671
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
7434
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
7275
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
1391
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
1299
by: Vik | last post by:
Is it possible to loop through all dataadapters on page? Thanks
2
1993
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
2277
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
1602
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
3477
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
2670
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
8991
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
8830
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
9324
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,...
1
6796
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
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3313
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
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.