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

ADO and Union Query Results

I'm using ADO from AutoCad to try and resolve this query from an
Access2000 database:
SELECT * FROM qryAllnotes WHERE tblProjNotes.KeyText = '*grade*';

It doesn't return any records, but without the WHERE clause, it does. I
know there are records there because I pasted into the Access query
builder and I get two records back. qryallnotes is a union query (if
that matters).

This is the string to open the recordset:
oRSNotes.Open sSQL, oDB1, adOpenStatic, adLockReadOnly

-mjm
Nov 12 '05 #1
5 1652
michael montagne wrote:
I'm using ADO from AutoCad to try and resolve this query from an
Access2000 database:
SELECT * FROM qryAllnotes WHERE tblProjNotes.KeyText = '*grade*';
Are you searching for records where KeyText begins/ends with the word
*grade* or are you searching for records that contain *grade*?

It doesn't return any records, but without the WHERE clause, it does. I
know there are records there because I pasted into the Access query
builder and I get two records back. qryallnotes is a union query (if
that matters).

This is the string to open the recordset:
oRSNotes.Open sSQL, oDB1, adOpenStatic, adLockReadOnly

-mjm


Nov 12 '05 #2
I want reords that contain "grade".

Salad wrote:
michael montagne wrote:
I'm using ADO from AutoCad to try and resolve this query from an
Access2000 database:
SELECT * FROM qryAllnotes WHERE tblProjNotes.KeyText = '*grade*';

Are you searching for records where KeyText begins/ends with the word
*grade* or are you searching for records that contain *grade*?

It doesn't return any records, but without the WHERE clause, it does.
I know there are records there because I pasted into the Access query
builder and I get two records back. qryallnotes is a union query (if
that matters).

This is the string to open the recordset:
oRSNotes.Open sSQL, oDB1, adOpenStatic, adLockReadOnly

-mjm


Nov 12 '05 #3
michael montagne wrote:
I want reords that contain "grade".

Salad wrote:
michael montagne wrote:
I'm using ADO from AutoCad to try and resolve this query from an
Access2000 database:
SELECT * FROM qryAllnotes WHERE tblProjNotes.KeyText = '*grade*';


Are you searching for records where KeyText begins/ends with the word
*grade* or are you searching for records that contain *grade*?

Then change = to LIKE.
WHERE tblProjNotes.KeyText LIKE '*grade*';

Nov 12 '05 #4
If that does not work, then isn't there an issue with the preferred syntax
for the wildcard in ADO (vs. DAO) ?
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.
"Salad" <oi*@vinegar.com> wrote in message
news:SI*****************@newsread2.news.pas.earthl ink.net...
michael montagne wrote:
I want reords that contain "grade".

Salad wrote:
michael montagne wrote:

I'm using ADO from AutoCad to try and resolve this query from an
Access2000 database:
SELECT * FROM qryAllnotes WHERE tblProjNotes.KeyText = '*grade*';

Are you searching for records where KeyText begins/ends with the word
*grade* or are you searching for records that contain *grade*?

Then change = to LIKE.
WHERE tblProjNotes.KeyText LIKE '*grade*';

Nov 12 '05 #5
I had tried like (bad me for not posting that version, I know it is
correct). It turns out that you need to use "%" for the wildcard.
Thanks both for your aid.

Michael (michka) Kaplan [MS] wrote:
If that does not work, then isn't there an issue with the preferred syntax
for the wildcard in ADO (vs. DAO) ?

Nov 12 '05 #6

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

Similar topics

5
by: michael montagne | last post by:
I'm using ADO from AutoCad to try and resolve this query from an Access2000 database: SELECT * FROM qryAllnotes WHERE tblProjNotes.KeyText = '*grade*'; It doesn't return any records, but without...
4
by: shaun palmer | last post by:
when or Where do you use a union query ? how can I wright sql, tblPopulation,* tblcustomer,* one to one with all the appropriate attributes(field). Your help would be greatly...
1
by: PATGMorris | last post by:
I've got a Union Query that pulls data from two different tables for chemistry and micro testing. The tables containing very similar data but for reasons not necessary here, cannot be put into one...
2
by: Lyn | last post by:
Hi, How do you bind the output columns from a UNION query when the fields from the two tables have different names? Consider this query (WHERE clauses omitted)... SELECT SurnameBirth,...
5
by: BillCo | last post by:
I'm having a problem with a union query, two simple queries joined with a union statement. It's created in code based on parameters. Users were noticing some inconsistant data and when I analysed...
1
by: catudalg | last post by:
Configuration: Windows 2000 sp3 MS Access 2000 (9.0.4402 SR-1) Visual Foxpro 9.0 detached tables MS VFP Driver 6.01.6830.01 06/19/2003 For example, a simple query like: select * from ddwg1...
8
by: kepston | last post by:
I have a situation where I need to record scrap quantities for parts that we sell and parts that are supplied, in a single table. I have a UNION query that combines the part numbers successfully,...
1
by: bgreenspan | last post by:
Hi Everyone, I'm back for some more expert help. Here's what I am doing and what I tried. My database has entries with Contract Names and Expiry Dates, among other fields. I have a form...
6
by: jmarcrum | last post by:
Hi! I have created a Union Query in ACCESS 2003, that combines 130 records from one query (Extra Foreman Radios) and 250 records from another query (Forman Main Radios). I have created a...
1
by: napstar | last post by:
I have a dropdown list which has an sqldatasource but I'd like the first item on the list to be "Please Select A Title".I tried using a UNION query : SELECT MessageTable.Title FROM...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.