By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

ADO and Union Query Results

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.