Here is how I do it.
1. Add a reference to Microsoft DAO in your VB project
2. Create the "Make Table" Query in Access design view
3. Change to SQL view
4. In your VB code use "db.execute" then add the copied SQL Query from Access in parenthesis and quotes. The results should be similiar to the statement below. This particular code example creates a table named 'CAtable' which consists of the records where the state = "CA" You will have to change any inner quotes from " " to ' '



Dim db As Database

Set db = OpenDatabase("c:\pathname\Data.mdb")

db.Execute ("SELECT SRAC1.OHCCode, SRAC1.OHCName, SRAC1.OHCAdd1, SRAC1.OHCAdd2, SRAC1.OHCCity, SRAC1.OHCState, SRAC1.OHCZip INTO CAtable FROM SRAC1 WHERE (((SRAC1.OHCState)='CA'));")


Good Luck!

Zimmerman, Scott wrote:

Hello,
I am able to run an Access DB query using VB object code but from what I
have researched action queries can not be run in the same way.  Has anyone
done this before?  The action query makes a table.

thanks,

Scott Zimmerman, LIS Analyst
UMass Memorial, Worcester, MA
Email: [EMAIL PROTECTED]
Office: 508-334-7237
Pager: 508-426-2178
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, transmission, re-transmission, dissemination or other
use of, or taking of any action in reliance upon this information by persons
or entities other than the intended recipient is prohibited. If you receive
this in error, please contact the sender and delete the material from any
computer.







-- Neil Carman Director Technical Development Manigault & Associates LLC

http://www.m-allc.com
Work: (805) 680-5601
Fax:  (714) 968-5632



Reply via email to