![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 1
|
Is there a way to force an existing Microsoft Query to point to a different relational database. In other words, in an environment with multiple AS/400's, is it possible to create a flexible ODBC connection that can download data based on user selection as to data origin.
|
|
|
|
|
|
#2 | |
|
Board Regular
Join Date: Feb 2002
Posts: 3,064
|
Quote:
I suggest having many codes say in userfor and select as needed each connection, should not be hard if you kopen3live via MS Quesry ODBC driver into excel can record and edit as nneds be.. i record to get ODBC connect lines perfect each time. hope this hekp a little.. PS As400??? Good system, funny i wrote a debtors report download for a company in AS400 on ODBC, fine kit, but watch them copy and paste size boxes you draw... else bits go missing never got used to boxes to copy from higlight lines..
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
I'm not familiar with ASA400 but here is a connection string I found in a help file. Maybe it will give you an idea of what you need to do?
Creating a DSN 'On the Fly' So far, each of our connections has assumed that we have previously defined a Data Source Name (DSN). The DSN describes a data source, and the standard settings to be used when attaching to it. However, this can be limiting in some circumstances—especially when attaching to data sources that are dynamic in nature. For example, let’s take a situation where the user connects to several servers, depending on the information they need. We could setup an ODBC Data Source Name definition for each server and selectively attach to it. A better way is to create the connection 'on the fly', without using a DSN: ServerName = Request.QueryString("ServerName") 'from the submitted page DBConn.Open "Driver={SQL Server};Server=" & ServerName & _ ";UID=sa;PWD=;WSID=MAINFRAME;Language=us_english;Database=Forum;DSN=;" ... In this example we create a definition on the fly, using the server name from a form submitted by the user to determine which SQL Server to attach to Tom |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,064
|
I cant ttst from here but the string you require can this not ve recoded and edited as needed?
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|