Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HOW DO I INSERT USING OPENQUERY INTO A ACCESS LINKED FILE

0 views
Skip to first unread message

bridor

unread,
Feb 5, 2002, 10:31:35 AM2/5/02
to
hi!
i hope someone will help!
i'm using sqlserver 2k
i've linked a microsoft access (*.mdb) as a linked server into my sqlserver
using a dsn with a microsoft ole db provider for odbc driver
i'm able to execute selects statment from that linked file as:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select * from openquery(mylinkedmdb,'select * from mylinkedmdb_table')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

my problem is that i 'm not able to execute insert statment into that linked
server
i'd like someone tell me how is that done!!

i've tryed :

insert into mylinkedmdb.tbname(a,b,c)
select a,b,c from sqlservr_tablename

and

insert into mylinkedmdb.tbname(a,b,c)
values (a,b,c)

and

insert into openquery(mylinkedmdb,'insert into mytable ( a , b , c )')
values (a , b , c )


without success

thanks! muchachos!
carlos

Russell Fields

unread,
Feb 6, 2002, 11:37:21 AM2/6/02
to
carlos,

Have you tried INSERT ... EXECUTE ('string') where the string is your
OPENQUERY statement?

Russell Fields
SQL Server MVP


"bridor" <crodr...@hybridor.com> wrote in message
news:#b$F1olrBHA.2632@tkmsftngp04...

Xiaoyu Li [MS]

unread,
Feb 6, 2002, 1:59:12 PM2/6/02
to
Hi,

How about using the following code:

select * FROM
OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'\\RemoteComputer\Share\Mydb.mdb';'admin';'', Table1)

Xiaoyu Li
Microsoft SQL Server Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

0 new messages