Solved

Automate QODBC Table to Access Table Import

Posted on 2013-01-31
2
883 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

758 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

14 Experts available now in Live!

Get 1:1 Help Now