473,398 Members | 2,427 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,398 software developers and data experts.

VB.Net syntax for an Access2003 SQL LIKE query?

Puzzled - I have a fairly simple query against an Access database that
wants to eliminate the records in the table where the DeviceType is
either MasterStation1 or MasterStation2 or ....

in other words, I want the records that do not involve the Master
Stations in our system.

So, I expect to just write

Select * from Device where DeviceType not LIKE '*MasterStation*'

That works fine in a direct query from inside Access's own Query tool.
But calling it from VB.Net with an ADO.Net DataAdapter does not.
All the Master Station records appear in the resultset. I've tried
it with an OledbCommand instead, I've tried many different variations
of the syntax, etc.

Any clue?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #1
2 4820
Hi,

Use % instead of *

Ken
------------------
"felecha" <fe*******@yahoo-dot-com.no-spam.invalid> wrote in message
news:40********@Usenet.com...
Puzzled - I have a fairly simple query against an Access database that
wants to eliminate the records in the table where the DeviceType is
either MasterStation1 or MasterStation2 or ....

in other words, I want the records that do not involve the Master
Stations in our system.

So, I expect to just write

Select * from Device where DeviceType not LIKE '*MasterStation*'

That works fine in a direct query from inside Access's own Query tool.
But calling it from VB.Net with an ADO.Net DataAdapter does not.
All the Master Station records appear in the resultset. I've tried
it with an OledbCommand instead, I've tried many different variations
of the syntax, etc.

Any clue?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 20 '05 #2
Thanks

That is so interesting.

In the Access environment, * works and % doesn't.

From VB.Net, % works and * doesn't.

I would think that when you tell VB.Net what provider you're going to
use in your ConnectionString property, it would know how to talk with
it. My provider is very specifically

"Provider=Microsoft.Jet.OLEDB.4.0;"

But hey, as my professor used to say, "Working is good."
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #3

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

Similar topics

9
by: Lauren Quantrell | last post by:
Hoping someonce can tell me what compatibility problems I might run into when I have to have my Access Project developed on Access2K run in a user environment where users are using Access2003 as...
6
by: Ryan Bounds | last post by:
Hi All We have upgraded from Access2000 to Access2003 with all service packs. The problem that we have is: When a user try's to filter a client the database crashes and close's Access2003,...
13
by: usenet | last post by:
How and where can one find out about the basics of VB/Access2003 syntax? I am a died in the wool C/C++/Java Linux/Unix programmer and I am finding it difficult to understand the program format...
4
by: Jan | last post by:
Have an SQL create/import script. Running this on SQL would make it create a table with some values. Can Access2003 somehow use such and SQL script? I went into SQL query view to try it out, but...
3
by: ouldm8 | last post by:
Hi everybody, How can i get SQL Source of my tables in ACCESS 2003?? Please help. Thanks
2
by: deependrapathak | last post by:
Hi All, I am currently facing a crutial problem in Access2003 in Windows XP on just 3 PCs, the Application throws some of the errors specified below : 1. Error Number : 3075 Function is not...
4
by: sumansengupta | last post by:
I created an access in access2003 , its being used in multiuser environment ..based on a particular value the database is automatically closed and only i can change the value. Even after the...
2
by: logo3 | last post by:
hello, I'm trying to fill the table named "ALBARANES" which is based on a query. The query use table "structureOK". There are 3 additional values should be updated. AS Expr2 AS Expr3 AS...
3
by: Ramchandar | last post by:
Hi, I am creating reports using VBA code. I have the same query in a querydef residing both in Access97 and Access2003. The result of this querydef is then moved to a table in Access97 and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.