Re: linked tables
From: Mark J. McGinty (mmcginty_at_spamfromyou.com)
Date: 12/23/04
- Next message: Peter Newman: "Best Soloution"
- Previous message: Mark J. McGinty: "Re: Current Recordset does not support updating."
- In reply to: Jon Rizzo: "Re: linked tables"
- Next in thread: Paul Clement: "Re: linked tables"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Dec 2004 01:59:14 -0800
"Jon Rizzo" <jrizzo at langan dot com> wrote in message
news:OuGAJYG6EHA.824@TK2MSFTNGP11.phx.gbl...
> Yes, when I try to access the linked table, I get this error message:
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC Microsoft Access Driver] ODBC--connection to 'MyDatabase'
> failed.
>
>
> If I import the same table rather than linking it, the code works fine.
> What do I need to do in order to access this linked table?
>
> Jon
Personally I would create the link in the opposite direction, define a
linked server in SQL Server, then access the Jet table with a 4-part name
(actually two of the parts will be blank because Jet has neither object
ownership nor catalog constructs) e.g.,
SELECT * FROM [mydatabase].[owner].[sql_table] s INNER JOIN
[linked_server_to_jet]..[jet_table] j ON (s.jet_id = j.id)
Place-holders:
[mydatabase] -- SQL Server database in which [sql_table] resides
[owner] -- SQL account that owns the table
[sql_table] -- Do we really need this definition?
[linked_server_to_jet] -- Name assigned to linked server object in SQL
Server
[jet_table] -- Table that resides in MS Jet (.MDB) database file
I know that way will work, plus you'll then be working with the SQLOLEDB
provider, instead of the one for Jet.
You might be able to work it the other way by creating a querydef based on a
pass-through, but it's been too long since I cared about Jet to remember for
sure.
-Mark
> "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
> news:9e7js0l09k0nai78jd0gphuve5amocej9c@4ax.com...
>> On Tue, 21 Dec 2004 11:08:24 -0500, "Jon Rizzo" <jrizzo at langan dot
>> com>
> wrote:
>>
>> ¤
>> ¤ Hello,
>> ¤
>> ¤ I am having a problem, and I was hoping that someone here could help
>> me.
> I
>> ¤ have an Access database define that contains two tables. There is a
> third
>> ¤ table defined in the Access database which is linked to a SQL Server
> table.
>> ¤ While I am in the Access environment, I can query between the linked
>> and
>> ¤ non-linked tables, but when I try to run a query that joins the linked
>> &
>> ¤ non-linked tables through ADO, it can't seem to access the linked table
>> ¤ properly.
>> ¤
>> ¤ Can somebody explain to me how this is done in ADO?
>> ¤
>>
>> What do you mean by "can't seem to access the linked table properly"? Are
> you getting an error? A
>> prompt for a user name and password?
>>
>>
>> Paul ~~~ pclement@ameritech.net
>> Microsoft MVP (Visual Basic)
>
>
- Next message: Peter Newman: "Best Soloution"
- Previous message: Mark J. McGinty: "Re: Current Recordset does not support updating."
- In reply to: Jon Rizzo: "Re: linked tables"
- Next in thread: Paul Clement: "Re: linked tables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|