how to save Passthrough Query result

SKV

Active Member
Joined
Jan 7, 2009
Messages
257
I have a pass-through query that is running on a remote database (through ODBC connection).

If I try to save the results of the query, it gets saved to the remote database and not on my Machine.

How can I save these results on my local machine. Due to IT restrictions I am not allowed to save results on the server.

Any pointers???
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
When you say "local machine", do you actually mean on your computer's physical hard-drive (usually the C drive) or on the network your PC uses?

We have a similar situation, in which the database is on a SQL server, and our computers are on a separate network. We got around this by mapping one of the drives from our non-SQL network to the machine that the SQL network is housed on. So the queries that are run from there can be saved to a netweork drive that we have access to from our local machines.

Your IT guys should be able to set that up for you.
 
Upvote 0
Yes I mean local machine. I want to save the results on the local machine.
Is there a work around for this??



When you say "local machine", do you actually mean on your computer's physical hard-drive (usually the C drive) or on the network your PC uses?

We have a similar situation, in which the database is on a SQL server, and our computers are on a separate network. We got around this by mapping one of the drives from our non-SQL network to the machine that the SQL network is housed on. So the queries that are run from there can be saved to a netweork drive that we have access to from our local machines.

Your IT guys should be able to set that up for you.
 
Upvote 0
If I need to grab data from another system I usually do this:

1. Pass-through to grab what I need
2. Make-table based on the pass-through to turn it onto a local data set. Then you can treat it as Access data; using Access functions and calcs for example, will be much quicker once the data is in an Access table. Otherwise each record is evaluated on ther server app before you pull it across.

Something else to consider; if you will be converting and trashing large recordsets, make sure you set the DB to Compact On Close (Tools > Options). You can also create the new table in another Access DB if you want to keep the size down. It's an option on the dialog when you nominate the table name.

Denis
 
Upvote 0
Denis,

I tried your steps and when I try to make a table out of the pass through query, then it makes the table in the remote server only and NOT on my local machine. May be I am doing in wrong process. Can you please specify you Step 2 in more detail.

My intent is just to capture the result of a pass-through query (from a remote server) to a local machine in a table in access

Thanks
SKV


If I need to grab data from another system I usually do this:

1. Pass-through to grab what I need
2. Make-table based on the pass-through to turn it onto a local data set. Then you can treat it as Access data; using Access functions and calcs for example, will be much quicker once the data is in an Access table. Otherwise each record is evaluated on ther server app before you pull it across.

Something else to consider; if you will be converting and trashing large recordsets, make sure you set the DB to Compact On Close (Tools > Options). You can also create the new table in another Access DB if you want to keep the size down. It's an option on the dialog when you nominate the table name.

Denis
 
Upvote 0
First step: create a pass-through query (qptMyQuery)
Second step: New query, using qptmyQuery as the data source. Select all fields, change it to a Make-table, select the destination and give the table a name.

That should create a local Access table for you.

Denis
 
Upvote 0
Denis,

When I try to run the query after following the step 2, I am asked for a ODBC connection. What information should I put here? Without this information it is not letting me to run step 2.

Thanks
SKV

First step: create a pass-through query (qptMyQuery)
Second step: New query, using qptmyQuery as the data source. Select all fields, change it to a Make-table, select the destination and give the table a name.

That should create a local Access table for you.

Denis
 
Upvote 0
If you use ODBC then you need to add this to the Properties for the Pass-through query if you do not want to answer the dialog box each time.

Open the query in design view, right click on the blue bar across the top of the query editing box (to see which might require taking the box out of "Maximize"), click on properties, and then click the box with three dots (aka Build) to the right of the line in the properties box labelled "ODBC Connect Str".

This will take you to the "Select Data Source" dialog of the ODBC manager. Pick the User or System ODBC driver you set up for the target database. You will be shown a login dialog box for the database, into which you put your identifying characteristics like User ID and Password. You will then see a dialog box which ask whether you want to save the password in the connect string.

This will eventually put into the ODBC Connect Str property a string which will look something like "ODBC;DSN=DatabaseODBCIdentifier;UID=YourUserID;PWD=YourPassword;
DBQ=TheOracleDatabaseConnectionName;DBA=W;APA=T;EXC=F;FEN=T;
QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=F;BAM=IfAllSuccessful;
MTS=F;MDI=F;CSR=F;FWC=F;PFC=10;TLO=0;"

If you say to save the Password, then this will automaticaly work until you change your password. If you do not save the password, then you will have to enter it each time. And of course, if you distribute this to other users then they will look to the database as if they are you (not cool - don't do that). If you need to distribute this then manually edit out the User ID and password parameters before you distribute, or before you put this into a shared Access database.

And BTW, thank you Mr SydneyGeek. I would not have thought of that idea, and it solved my problem very nicely.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top