Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2004, 05:01 AM
rjp rjp is offline
Registered User
 
Join Date: Aug 2004
Location: Perth, WA, Australia.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADODB sql in Access VBA

the access vba threads are locked so this is the next best place.

I have written code in VBA using ADODB to modify Access tables (not unusual in itself). Is there any good reason why ADODB does not recognise '*' as a wildcard character?
I found that '%' seems to work the way '*' should???
Its lucky i dont need to do much in the way of character wildcards because if '%' = '*' then what equals '%' ie how do you specify a wildcard character (alphanumeric)

I hope that makes sense.


 
Old August 25th, 2004, 08:43 AM
Authorized User
 
Join Date: Jul 2004
Location: cleveland, oh, USA.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

% is the wildcard for ADODB, * is for Jet. If you wanted to use *, you would have to use DAO not ADO. I don't fully understand the rest of your question though...
 
Old August 25th, 2004, 07:27 PM
rjp rjp is offline
Registered User
 
Join Date: Aug 2004
Location: Perth, WA, Australia.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the clarification on the wildcard conventions.

The second question (written overly convoluted-apologies) was simply:
what is the single character wildcard for ADO?

Like i should have done in the beginning i did a search and found that the MSDN site had this to say about wildcards differences between ADO and DAO (see bottom part). Anyhoo maybe this will be of help to someone else.

"*******The ADO monkey wrench*********
Though Access supports SQL statements, Access SQL doesn't completely adhere to ANSI SQL standards. In Access 97, Access SQL most closely resembles the SQL-89 standard. However, with the release of Jet 4.0 in Access 2000, Access SQL was updated to more closely emulate the SQL-92 standard through syntax exposed by ADO and the Microsoft Jet OLE DB Provider. This impacts many aspects of using SQL statements in code, one of which is wildcard behavior. The pattern-matching characters we looked at last month were provided through DAO. Rather than using the asterisk (*) and question mark (?) symbols as wildcards, ADO requires that you use the percent sign (%) to match multiple characters and the underscore (_) to match a single character. There's no single-digit wildcard available through ADO that equates to DAO's pound sign wildcard (#); however, character lists and ranges behave the same."







Similar Threads
Thread Thread Starter Forum Replies Last Post
Which Book for VBA/Access/SQL/Excel? rmg VB Databases Basics 0 July 29th, 2004 03:19 PM
Access VBA - SQL question. Raelz Access VBA 4 February 10th, 2004 11:28 PM
Access 2002 VBA with SQL using a variable cpopham Access VBA 8 December 4th, 2003 04:24 PM
Date in Access VBA (SQL) Kenny Alligood Access VBA 2 September 14th, 2003 08:35 AM
Access SQL/VBA help danielwajnberg Access 4 September 2nd, 2003 06:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.