Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Result of SQL query?

Status
Not open for further replies.

vvilan

Technical User
Jul 29, 2008
16
0
0
US
In php, we could get the result from the query by executing it and then use mysql_fetch_array($queryresult). How can we use something of this nature in access? Thanks!

PS. Does access have an API for their vba?
 
I am a vast well of ignorance about php (among other things) but in Access you would use a recordset.
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb()
Set rs = db.Openrecordset("Select * From SomeTable")

Do Until rs.EOF
   SomeValue = rs![SomefieldName]
   ' ... etc. ...
   rs.MoveNext
Loop
 
How are ya vvilan . . .

[blue]Golom[/blue] has the exact answer you require. [blue]Recordsets[/blue] are the replacement for what you ask and is a well deversified subject. Look it up in VBA help!

BTW: Welcome to [blue]Tek-Tips![/blue] [thumbsup2] Do have a look at one of the links at the bottom of my post. The links will help you [blue]ask better questions[/blue], get [blue]quick responses[/blue], [blue]better answers[/blue], and insite into [blue]etiquette[/blue] here in the forums. Again . . . Welcome to [blue]Tek-Tips![/blue] [thumbsup2] . . . [blue]Its Worthy Reading![/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top