473,500 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ODBC Query of Access 2000 db using LIKE

Attempting to query MS Access database with the ODBC drivers for PHP. When
using the LIKE statement no records are returned.

Example:

$query = " Select * From Dispatch Where Customer Like '*A*' ";
$result = odbc_prepare($db,$query);
odbc_execute($result);

Does anyone out there know the syntax that I should be using for the Like
statement in the Where clause? When I do a normal query, it works
fine....Just using wildcards it does not work....
Jul 17 '05 #1
5 4328
Jahmil Richardson <ja****@thehelpesk.com> wrote:
$query = " Select * From Dispatch Where Customer Like '*A*' ";

Does anyone out there know the syntax that I should be using for the Like
statement in the Where clause? When I do a normal query, it works
fine....Just using wildcards it does not work....


It works perfectly, you are just to lazy to search for a correct
example:
http://www.google.com/search?q=sql+l...ldcard+example

First link explains it all.

--

Daniel Tryba

Jul 17 '05 #2
I noticed that Message-ID: <c6**********@news.tue.nl> from Daniel Tryba
contained the following:
Jahmil Richardson <ja****@thehelpesk.com> wrote:
$query = " Select * From Dispatch Where Customer Like '*A*' ";

Does anyone out there know the syntax that I should be using for the Like
statement in the Where clause? When I do a normal query, it works
fine....Just using wildcards it does not work....


It works perfectly, you are just to lazy to search for a correct
example:
http://www.google.com/search?q=sql+l...ldcard+example


That's unfair. Access databases use the asterisk as a wild card.

I've not written a LIKE query with my ODBC setup so I can't help I'm
afraid.

It may be an idea to try the % though.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3
Geoff Berrow <bl******@ckdog.co.uk> wrote:
$query = " Select * From Dispatch Where Customer Like '*A*' ";

Does anyone out there know the syntax that I should be using for the Like
statement in the Where clause? When I do a normal query, it works
fine....Just using wildcards it does not work....


It works perfectly, you are just to lazy to search for a correct
example:
http://www.google.com/search?q=sql+l...ldcard+example


That's unfair. Access databases use the asterisk as a wild card.


If that is correct, that I appologize to the OP.

--

Daniel Tryba

Jul 17 '05 #4
Sadly, that IS correct. Access hath its quirks.
IIRC, Access needs the token string to be surrounded by double quotes, so
perhaps the OP could try rewriting the query as:
$query = 'Select * From Dispatch Where Customer Like "*A*"';

HTH
Doug

--
Remove the blots from my address to reply
"Daniel Tryba" <ne**************@canopus.nl> wrote in message
news:c6**********@news.tue.nl...
Geoff Berrow <bl******@ckdog.co.uk> wrote:
$query = " Select * From Dispatch Where Customer Like '*A*' ";

Does anyone out there know the syntax that I should be using for the Like statement in the Where clause? When I do a normal query, it works
fine....Just using wildcards it does not work....

It works perfectly, you are just to lazy to search for a correct
example:
http://www.google.com/search?q=sql+l...ldcard+example


That's unfair. Access databases use the asterisk as a wild card.


If that is correct, that I appologize to the OP.

--

Daniel Tryba

Jul 17 '05 #5
Ooops.. typo..
$query = 'Select * From Dispatch Where Customer Like \"*A*\"';
"8-{
--
Remove the blots from my address to reply
"Doug Hutcheson" <do*****************@nrm.blot.qld.blot.gov.blot.au > wrote
in message news:XK******************@news.optus.net.au...
Sadly, that IS correct. Access hath its quirks.
IIRC, Access needs the token string to be surrounded by double quotes, so
perhaps the OP could try rewriting the query as:
$query = 'Select * From Dispatch Where Customer Like "*A*"';

HTH
Doug

--
Remove the blots from my address to reply
"Daniel Tryba" <ne**************@canopus.nl> wrote in message
news:c6**********@news.tue.nl...
Geoff Berrow <bl******@ckdog.co.uk> wrote:
>> $query = " Select * From Dispatch Where Customer Like '*A*' ";
>>
>> Does anyone out there know the syntax that I should be using for the Like>> statement in the Where clause? When I do a normal query, it works
>> fine....Just using wildcards it does not work....
>
>It works perfectly, you are just to lazy to search for a correct
>example:
>http://www.google.com/search?q=sql+l...ldcard+example

That's unfair. Access databases use the asterisk as a wild card.


If that is correct, that I appologize to the OP.

--

Daniel Tryba


Jul 17 '05 #6

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

Similar topics

3
3898
by: Richard Muller | last post by:
Hi All, I've got the ASP script shown below that complains as follows: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Data source name not found and no default driver specified...
11
3731
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
6
6749
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
1
1546
by: Tim | last post by:
Hi all, Here is a brief description of a problem I encountered, and how I found a work around after 3 long days. I have a VB6 app that uses ADO and ODBC to get communicate with SQL server 2000...
0
1808
by: LesM | last post by:
This is a change of behaviour between Access 2000 SP3 and Access 2002 SP3. I have Progress table that is linked via ODBC into Access using OpenLink Lite for Progress 9.0b. For over a year, using...
14
10099
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
8
4022
by: Alfonso Esteban Gonzalez Sencion | last post by:
I am trying to use Access as a front end for extracting information from an Oracle database. I started using linked tables but I am getting a very curious behaviour. When I consult the linked...
2
1899
by: Bibi | last post by:
Hi, i have a SqlWindows Program which made a connection to a MS Access Database about ODBC. I can get all datas with a select about one table. But when i made a select with more than one table,...
4
3557
by: Dave | last post by:
Hey guys, I have an ODBC problem that has me stumped. I wrote a VBA script to run in Microsoft Excel that pulls data out of an application using that application's ODBC driver and puts it into...
2
6619
by: teddysnips | last post by:
One of our clients has reported a problem. Everything was working fine on Monday, but since Tuesday all is going wrong. The sysadmin assures me that there have been no changes to the network, or...
0
7018
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
7235
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...
1
6909
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...
0
7397
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...
0
5491
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,...
1
4923
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...
0
3110
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...
0
1431
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 ...
0
317
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...

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.