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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View recordset as a 'datasheet' ?

Status
Not open for further replies.

helpdavid

Programmer
Sep 18, 2002
1
AU
I am a Foxpro programmer migrating to Access 2002.
In Foxpro you can easily and quickly view the results of a SQL select by "Browsing" the cursor generated in a window. The Browse window is very similar to opening a query or table by double clicking in the Access database window.
I intend to work with ADO recordsets, and would like to view/browse a recordset generated from a query without the overhead of seting up a form and controls. I am just looking for a quick, easy method to view a recordset, mainly to check that the resultant data is what I intended before further processing and development.
Sometimes the simpler things are the hardest to uncover!
Many thanks Dave
 
Hi

See Docmd.OpenQuery

Syntax

DoCmd.OpenQuery queryname[, view][, datamode]

The OpenQuery method has the following arguments.

Argument Description

queryname A string expression that's the valid name of a query in the current database.
If you execute Visual Basic code containing the OpenQuery method in a library database, Microsoft Access looks for the query with this name first in the library database, then in the current database.
view One of the following intrinsic constants:
acViewDesign
acViewNormal (default)
acViewPreview
If the queryname argument is the name of a select, crosstab, union, or pass-through query whose ReturnsRecords property is set to –1, acViewNormal displays the query's result set. If the queryname argument refers to an action, data-definition, or pass-through query whose ReturnsRecords property is set to 0, acViewNormal runs the query.
If you leave this argument blank, the default constant (acViewNormal) is assumed.
datamode One of the following intrinsic constants:
acAdd
acEdit (default)
acReadOnly
If you leave this argument blank, the default constant (acEdit) is assumed.

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top