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 2007

Tip: Looking for answers? Try searching our database.

use of * caracter in rst.Open strSQL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
phleduc - 13 Nov 2007 17:00 GMT
use of * caracter in rst.Open strSQL
try: strSQL = "SELECT * FROM QrycustomersReport WHERE [cuscompanyName] like
"*test*"
You can use the strSQL to change the recordsource of a form, returns all
company names that include test in their name string.
However when you use the * caracter in an ado statement, the recordset
return no records.
rst.recordcount will always return 0
Any solution for this?

       Dim rst As ADODB.Recordset
       Set rst = New ADODB.Recordset
       rst.ActiveConnection = CurrentProject.Connection
       rst.CursorType = adOpenStatic
       rst.Open strSQL

       MsgBox rst.RecordCount

       rst.Close
       Set rst = Nothing
Douglas J. Steele - 13 Nov 2007 17:23 GMT
Already answered in another newsgroup to which you posted the same question.

If you feel you need to post to more than one group (HINT: it's seldom
necessary), please have the courtesy to cross-post (send the one message to
all groups at once), rather than multi-post (send individual messages to
each group). In this way, all responses to your post will be available
together, regardless of what group the responder was in, and the rest of us
won't have to read your post multiple times. (It also uses fewer server
resources)

I see you're using Outlook Express. Click the "Newsgroups:" label to the
left of the box containing the name of the current newsgroup. That will open
a dialog that will let you add additional newsgroups to your post.

Note that it's generally consider to be A Bad Thing to cross-post to more
than 2 or 3 groups.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> use of * caracter in rst.Open strSQL
> try: strSQL = "SELECT * FROM QrycustomersReport WHERE [cuscompanyName]
[quoted text clipped - 16 lines]
>        rst.Close
>        Set rst = Nothing
phleduc - 13 Nov 2007 18:32 GMT
Hi Doug,

Sorry, did not realize I could cross post and that it was condidered "A bad
Thing" to post to more then one group.
Will comply in the future!

Philip

Will comply
> Already answered in another newsgroup to which you posted the same
> question.
[quoted text clipped - 34 lines]
>>        rst.Close
>>        Set rst = Nothing
phleduc - 13 Nov 2007 18:35 GMT
PS I see you like beer, as a Belgian (living in the USA) I can still
appreciate a good beer once in a while.

> Already answered in another newsgroup to which you posted the same
> question.
[quoted text clipped - 34 lines]
>>        rst.Close
>>        Set rst = Nothing
 
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.