473,756 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4839
Hi,

Use % instead of *

Ken
------------------
"felecha" <fe*******@yaho o-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 ConnectionStrin g property, it would know how to talk with
it. My provider is very specifically

"Provider=Micro soft.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
2417
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 well as Access2000. I have already seen a problem where if I open my project using Access2003 and save any objects, then run it on Access2000, I encounter "Bad DLL Calling Convention error..." on the Access2K machines. If I never open and save the...
6
2009
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, this is happening on a regular basis. We never had this problem in Access2000. Would it be something to do with code?
13
3033
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 for accessing objects, controls, etc. in VB/Access2003. In particular where will I find explanations of:- Actions, Functions, Methods, Properties - I'm understand the
4
3339
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 the amount of data was too big to paste in according to Access. Sample data: -- -- PostgreSQL database dump
3
1418
by: ouldm8 | last post by:
Hi everybody, How can i get SQL Source of my tables in ACCESS 2003?? Please help. Thanks
2
1726
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 available in expressions in query expression 'Format(,"$#,##0.00")' . 2. On Click Error : The expression you entered refers to an object that is closed or doesn't exist. 3. On Click Error : Function is not available in expressions in query...
4
2161
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 database is closed the .ldb file exist .. Now I tried your code die.cfm from the following website http://evolt.org/node/3644 , not very sure how to use it , because with the .cfm extension its not getting executed , can you suggest how can i get it...
2
9595
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 Expr1 I did this in access2003 and it works but each time I start the query I will be asked to enter a date, subject and text.
3
1960
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 Access2003 respectively. The table in Access97 returns 874 rowcount, table in Access 2003 returns 1050 rowcount. In both the case the querydef is retrieving from the same database which resides in SQL Server 2003. I executed the application Access97 and...
0
9431
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
9255
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,...
0
10014
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9819
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
7226
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
6514
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
5119
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
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2647
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.