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!

Urgent: Running a select query and exporting a table from VB6

Status
Not open for further replies.

MattBegg

Programmer
Jan 19, 2001
42
0
0
CA
I am looking to export to CSV a table that has been refined via a select query. The query refines the table to new additions since the query was last run based on a flag.

I am looking for a way to execute this query and then export the query from VB6.

Your help would be much appreciated Regards

Matt

matt@begg-uk.co.uk
 
I am sure that someone will have a better answer, but the first thing that comes to my mind is to turn the query into a MAKE TABLE query to create a separate table to export just the new records from. Then you could use the TRANSFERTEXT (?) action/method to export it. After that, delete the table. Remember to compact as needed, that deleted table will still be around.

Hope that is a start... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
th3856

I am looking at how to code the equivalent of the transfertext function in visual basic 6. I have set up an export spec and even created a macro that will run the macro. Regards

Matt

matt@begg-uk.co.uk
 
Well, you could call the macro from a VB code module:

DoCmd.RunMacro "Print Sales"

or you could leave out the macro and call the TransferText function from a VB code module:

DoCmd.TransferText acExportDelim, "Standard Output", "External Report", "C:\Txtfiles\April.doc"

Maybe I am confused. I did go to sleep last night and I haven't been retrained yet today... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top