Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

Problem with Wildcards using a Cursor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dberman - 21 Nov 2006 18:16 GMT
The query:
SELECT *
FROM tblCapitalAssets
WHERE Asset Like "C-*"

It works as a direct Access query.  It works as a Record Source in a list
box.  But it does not work when submitted through a cursor

 With rs
   .CursorType = adOpenDynamic
   .LockType = adLockOptimistic
   .Open query, cn1, , , adCmdText
 End With

Same query without the "*" works.

Any ideas.
Signature

Don Berman
Computer Sciences Corp.

Alex Dybenko - 21 Nov 2006 18:28 GMT
Hi,
try to use "C-%", wildcards syntax in ADO is bit different

Signature

Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> The query:
> SELECT *
[quoted text clipped - 13 lines]
>
> Any ideas.
dberman - 21 Nov 2006 18:55 GMT
That works.  Must use * in the listbox queryt but % in cursor query.  A great
Microsoft feature!  Wonder who thought of it.
Signature

Don Berman
Computer Sciences Corp.

> Hi,
> try to use "C-%", wildcards syntax in ADO is bit different
[quoted text clipped - 16 lines]
> >
> > Any ideas.
onedaywhen - 23 Nov 2006 08:31 GMT
> Must use * in the listbox queryt but % in cursor query.  A great
> Microsoft feature!  Wonder who thought of it.

Microsoft was late to embrace the ANSI SQL Standard; alternatively:
Access used to be way ahead of its time <g>.

For the details, see:

About ANSI SQL query mode (MDB)
http://office.microsoft.com/en-gb/access/HP030704831033.aspx

"traditional Jet SQL syntax [...] wildcard characters conform to the
Visual Basic for Applications (VBA) specification, not SQL... ANSI-92
[query mode] provides new [...] wildcard characters that enhance your
ability to create queries, filters, and SQL statements."

Jamie.

--
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.