| Querying Multiple Company Files |
| Author |
Message |
|
|
| Posted : 2009-02-12 12:58:21 |
| I am trying to create an application that will query different company database files, about 20, to get various information from each company. I know I can create a DSNless connection and change the company settings as I go through the company list, but is there a way to open several company files at once, or at least query each company while people are in them without prodcuing any locking (e.g. exiting companies requires additional apps to be logged out, prompting for access by application). |
|
|
|
|
|
| Posted : 2009-02-12 16:28:36 |
| Sorry, it's QuickBooks that can only have one company file open at the one time on the one computer. You have to open and close each connection to each company file one by one. |
|
|
|
| SWT |
| |
| Group | : Members |
| Posts | : 22 |
| Joined | : 2006-11-09 |
|
| Profile |
|
| Posted : 2009-10-03 02:35:42 |
I have an access database that gathers information from 23 different QB company files. I needed to do two things in order accomplish this:
1. use passthrough queries
2. use the "runapp" function in Access macros. The app the runapp will point to is a .bat file you create on your hardrive. Put this text in the .bat file "taskkill /F /IM QBW32.exe /FI "USERNAME eq [enter your windows user name here]". so for example my user name is strewartha so my .bat file contains this text - taskkill /F /IM QBW32.exe /FI "USERNAME eq strewartha"
This way, the .bat file is ran each time between companies so that the QB executable is reset each time.
Note: the command line on my runapp is c:\sean.bat and inside my sean.bat file i have this text == taskkill /F /IM QBW32.exe /FI "USERNAME eq strewartha |
|
|
|
|
|
| Posted : 2010-05-20 16:14:32 |
| Is there a way to setup queries using MS Query that will query different datafiles one at the time by using the refresh method? What I'm asking is can you setup a connection string that tells QODBC to connect to a specific data file and return data from that file, or would you need to use VBA for that? |
|
|
|
|
|
| Posted : 2010-05-20 17:02:36 |
As far as MS Query is concerned, you just need to setup a different DSN for each company file and simply close the connection and open another DSN when you want to query that company file.
See: How do I create or configure a QODBC DSN? for further information. |
|
|
|
|
|
| Posted : 2010-05-20 22:50:58 |
| Hi Tom,
I've come across a weird phenomenon. I have setup the various DSN's with all companies giving access to QODBC for automatic logon even when QuickBooks is not running. I've tested all queries while QB is running and they work OK. When I then go to my Excel workbook and do a refresh on those queries, one at the time, QODBC reports that the specified user is not allowed to logon automatically. |
|
|
|
|
|
| Posted : 2010-05-21 11:55:32 |
When switching datafiles, this is what I get (Further to my post from yesterday)

When I then check in QuickBooks, I see
|
|
|
|
|
|
| Posted : 2010-05-22 22:12:02 |
| Try closing the Excel Workbook and then open it using another DSN. |
|
|
|