Change an ODBC connection on the fly?
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Change an ODBC connection on the fly?

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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. #2
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-25 08:25, MarkReo wrote:
    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.
    I guess possible it is by input box or what ever to select source, but il be blund ODBC is flaky enough and not that good, upsetting she she will only cry ande go shopping for some cloths or a hair do!

    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. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    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"

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com