Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Trying to query ODBC source without linked table

Discussion in 'Information Technology' started by adamss@ascinet.com, Jul 28, 2006.

  1. adamss@ascinet.com

    adamss@ascinet.com
    Expand Collapse
    Guest

    >From what I've seen in other posts, it looks like I should be able to
    run a query through Jet SQL that does something like

    select MyField from MyTable in "ODBC;DSN=MyDSN;UID=;PWD="

    When I do this, it tells me that it can't find the file
    "c:\ODBC;DSN=MyDSN;UID=;PWD=". Is there a way to directly query
    another database via ODBC just used Jet SQL?

    Thanks.
     
  2. Loading...

    Similar Threads Forum Date
    Spammers trying to convert me to Islam Questions and Answers Aug 27, 2015
    Leisure Okay, so I am trying to sing in a different language... Business, Lifestyle & Leisure Jul 8, 2014
    Canada Ontario politician trying to lure Quebec doctors affected by values charter Breaking News Sep 16, 2013
    World Why the NATO Powers are Trying to Assassinate Moammar Gaddafi Breaking News Jun 14, 2011
    Malaysia Malaysia Says Extremist Groups Trying to Recruit from Schools Breaking News Jan 7, 2011

  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Simply create a linked table then use it like any other table.

    Alternatively, create a pass-through query.

    Change your SQL to Select MyField From MyTable (i.e.: what you have already,
    without the in "ODBC;..." part) Instead, select SQL Specific from the Query
    menu, and choose the Pass-Through option. In the Query properties window,
    you should see a property labelled "ODBC Connect Str". Pasted what you had
    before in your "ODBC;..." string into that property.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    <adamss@ascinet.com> wrote in message
    news:1152732402.940715.248960@m73g2000cwd.googlegroups.com...
    > >From what I've seen in other posts, it looks like I should be able to

    > run a query through Jet SQL that does something like
    >
    > select MyField from MyTable in "ODBC;DSN=MyDSN;UID=;PWD="
    >
    > When I do this, it tells me that it can't find the file
    > "c:\ODBC;DSN=MyDSN;UID=;PWD=". Is there a way to directly query
    > another database via ODBC just used Jet SQL?
    >
    > Thanks.
    >
     
  4. Sylvain Lafontaine

    Sylvain Lafontaine
    Expand Collapse
    Guest

    If the name and location of the database file are C:\MyMDB.mdb then the
    following should work:

    select MyField from MyTable in "C:\MyMDB.mdb" ...

    Of course, writing something like C:\ODBC mean absolutely nothing; unless
    you have a database file with the name ODBC. If you want to use a DSN, then
    something like should work:

    select MyField from MyTable in "ODBC;DSN=MyDSN;UID=;PWD=". " ...

    However, this is very old stuff and I'm not sure if these will work.

    --
    Sylvain Lafontaine, ing.
    MVP - Technologies Virtual-PC
    E-mail: http://cerbermail.com/?QugbLEWINF


    <adamss@ascinet.com> wrote in message
    news:1152732402.940715.248960@m73g2000cwd.googlegroups.com...
    > >From what I've seen in other posts, it looks like I should be able to

    > run a query through Jet SQL that does something like
    >
    > select MyField from MyTable in "ODBC;DSN=MyDSN;UID=;PWD="
    >
    > When I do this, it tells me that it can't find the file
    > "c:\ODBC;DSN=MyDSN;UID=;PWD=". Is there a way to directly query
    > another database via ODBC just used Jet SQL?
    >
    > Thanks.
    >
     

Share This Page