Solved

Automate QODBC Table to Access Table Import

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

749 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