Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Automate QODBC Table to Access Table Import

Posted on 2013-01-31
2
Medium Priority
?
983 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

618 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