Problem with Wildcards using a Cursor

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
dberman said:
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.

--
 
Back
Top