Solved

Automate QODBC Table to Access Table Import

Posted on 2013-01-31
2
904 Views
Last Modified: 2013-02-04
I run reports against a QuickBooks database using a 3rd party ODBC tool called QODBC.
This works fine, but can be slow when doing involved reports.

If I use the QODBC to import into an access database, copying just the tables I need, the solution is very fast.

The problem is, I have to do the ODBC to Access import manually.  And since the Access Database isn't being udpated, the moment it's created it's outdated.  That's fine for the reports we generate, but it would be ideal if the Database was updated once per day, like at 2am or so.

Is there a way in VB.NET to copy a QODBC table to an Access database - if the Table already exists, to erase it and replace it with the new data?

I'm looking for some examples of this -  As an example, some reports take 15 minutes to run simply using QODBC.  After importing the data in Access, the report runs in 30 seconds.  This could be an awesome solution if I can get the import automated.

Thank you!
0
Comment
Question by:slightlyoff
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 38841778
I believe you can create linked tables with the QODBC driver. If so, then the simplest way to do this is to create the linked table, and then run a SELECT INTO query to create your table as needed.

You'd need to run a few SQL statements to do this:

YourConnection.Execute "DROP TABLE YourLocalAccessTable"
YourConnection.Execute "SELECT * INTO YourLocalAccessTable FROM YourLinkedQODBCTable"

You can do this through an OLEDB/ODBC connection in your .net program, or you could setup a simple macro in the Access database that could be run as needed.

You can run a macro using a command line from a Schedule Task:

"full path to msaccess.exe" "full path to your database" /x macroname
0
 
LVL 1

Author Closing Comment

by:slightlyoff
ID: 38852171
Thank you for your help!!!  

Also, for anyone following up on this - I found a link with the exact code I needed: http://www.access-programmers.co.uk/forums/showthread.php?t=169349
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now