473,418 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

appending local table to remote table using pass-through query

I'm using Access 2000 and I'm trying to create a pass-through query to
append all the data from a local table to a remote table.

I'm using the SQL query editor in MS Access to create the query (I
don't want to do this in VB code).

I've set up the ODBC connection string in the query properties, which
has been tested and works:
ODBC;DSN=dev001 student99;Description=dev001
student99;UID=myusername;PWD=mypassword;DATABASE=s tudent99;Network=DBMSSPXN

I want to append all the records from a table in my local Access
database called upload_test to the remote table called cst_record.
Both tables have the same design.

Here is the SQL I'm trying to use:
INSERT INTO cst_record
SELECT *
FROM upload_test;

This returns the error "Invalid object name 'upload_test'."
Obviously, it's trying to find the table upload_test on the remote
database and fails.
What's the syntax I should use to get it to look to the local Access
db for the upload_test table?
The local Access database filename is C:\TEST\UPLOAD_CST.MDB
Nov 13 '05 #1
6 10186
have you tried this?

INSERT INTO cst_record
SELECT *
FROM upload_test IN 'C:\TEST\UPLOAD_CST.MDB';

"Access Newbie" <ac****************@yahoo.com> wrote in message
news:51**************************@posting.google.c om...
I'm using Access 2000 and I'm trying to create a pass-through query to
append all the data from a local table to a remote table.

I'm using the SQL query editor in MS Access to create the query (I
don't want to do this in VB code).

I've set up the ODBC connection string in the query properties, which
has been tested and works:
ODBC;DSN=dev001 student99;Description=dev001
student99;UID=myusername;PWD=mypassword;DATABASE=s tudent99;Network=DBMSSPXN
I want to append all the records from a table in my local Access
database called upload_test to the remote table called cst_record.
Both tables have the same design.

Here is the SQL I'm trying to use:
INSERT INTO cst_record
SELECT *
FROM upload_test;

This returns the error "Invalid object name 'upload_test'."
Obviously, it's trying to find the table upload_test on the remote
database and fails.
What's the syntax I should use to get it to look to the local Access
db for the upload_test table?
The local Access database filename is C:\TEST\UPLOAD_CST.MDB

Nov 13 '05 #2
When I try that it returns the following error message:
ODBC--call failed
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near
the keyword 'IN'.(#156)

"Marvin Henry" <ma*********@earthlink.net> wrote in message news:<sN*****************@newsread2.news.atl.earth link.net>...
have you tried this?

INSERT INTO cst_record
SELECT *
FROM upload_test IN 'C:\TEST\UPLOAD_CST.MDB';

"Access Newbie" <ac****************@yahoo.com> wrote in message
news:51**************************@posting.google.c om...
I'm using Access 2000 and I'm trying to create a pass-through query to
append all the data from a local table to a remote table.

I'm using the SQL query editor in MS Access to create the query (I
don't want to do this in VB code).

I've set up the ODBC connection string in the query properties, which
has been tested and works:
ODBC;DSN=dev001 student99;Description=dev001

student99;UID=myusername;PWD=mypassword;DATABASE=s tudent99;Network=DBMSSPXN

I want to append all the records from a table in my local Access
database called upload_test to the remote table called cst_record.
Both tables have the same design.

Here is the SQL I'm trying to use:
INSERT INTO cst_record
SELECT *
FROM upload_test;

This returns the error "Invalid object name 'upload_test'."
Obviously, it's trying to find the table upload_test on the remote
database and fails.
What's the syntax I should use to get it to look to the local Access
db for the upload_test table?
The local Access database filename is C:\TEST\UPLOAD_CST.MDB

Nov 13 '05 #3
why not create a link to your SQL Server table in your Access DB and
then just create an append query?
Nov 13 '05 #4
pi********@hotmail.com (Pieter Linden) wrote in message news:<bf**************************@posting.google. com>...
why not create a link to your SQL Server table in your Access DB and
then just create an append query?


Because I have 1.5 million records to append to the SQL Server table
and doing it that way takes too long. I need to figure out how to do
it using a pass-through query.

BTW, I figured out how to do it using BCP on the command line, but
that involves an extra step of exporting the Access table to a text
file. I'd like to skip that step and use an Access pass-through query
to append to the SQL Server table directly, but I can't figure out how
to reference the local Access table in the SQL statement. Any ideas?
Nov 13 '05 #5
"Access Newbie" <ac****************@yahoo.com> wrote in message
news:51**************************@posting.google.c om...
pi********@hotmail.com (Pieter Linden) wrote in message

news:<bf**************************@posting.google. com>...
why not create a link to your SQL Server table in your Access DB and
then just create an append query?


Because I have 1.5 million records to append to the SQL Server table
and doing it that way takes too long. I need to figure out how to do
it using a pass-through query.

BTW, I figured out how to do it using BCP on the command line, but
that involves an extra step of exporting the Access table to a text
file. I'd like to skip that step and use an Access pass-through query
to append to the SQL Server table directly, but I can't figure out how
to reference the local Access table in the SQL statement. Any ideas?


PMFJI.

A pass-through query CAN'T reference a local Access table. Pass-through
queries run on the server: they don't know anything about the MDB that
they're located in.

Can you possible use DTS?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
Nov 13 '05 #6
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message news:<Wr*****************@news04.bloor.is.net.cabl e.rogers.com>...
"Access Newbie" <ac****************@yahoo.com> wrote in message
news:51**************************@posting.google.c om...
pi********@hotmail.com (Pieter Linden) wrote in message

news:<bf**************************@posting.google. com>...
why not create a link to your SQL Server table in your Access DB and
then just create an append query?


Because I have 1.5 million records to append to the SQL Server table
and doing it that way takes too long. I need to figure out how to do
it using a pass-through query.

BTW, I figured out how to do it using BCP on the command line, but
that involves an extra step of exporting the Access table to a text
file. I'd like to skip that step and use an Access pass-through query
to append to the SQL Server table directly, but I can't figure out how
to reference the local Access table in the SQL statement. Any ideas?


PMFJI.

A pass-through query CAN'T reference a local Access table. Pass-through
queries run on the server: they don't know anything about the MDB that
they're located in.

Can you possible use DTS?


Thanks for the info. Since I was ultimately able to do it using BCP
fairly easily, I'll just keep doing it that way.
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: miles111 | last post by:
Basically, can I execute a php script from within a php script? Heres some details: I'm using a remote script to get my local ip address using $HTTP_SERVER_VARS; This works. Now I want to run...
5
by: steve | last post by:
Hi, I finally figured out the best way to synch local and remote script folders, containing many php script files. What I used to do before was try to ftp all the changed files, etc. which was...
1
by: jason | last post by:
Is it actually possible for a local access 2000 database to link to a remote database online via linked tables... I know www.aspfaq.com has spoken about possibliites (although not secure) for...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
3
by: Daniel | last post by:
Is it possible to retain local file system read, write, delete access while impersonating for access to a remote drive in a different domain? I need to be able to move files from a local computer...
13
by: Shwetabh | last post by:
Hi, I wanted to know if it is possible to do to append two tables into a third table. For example, consider these two tables Table 1...
1
by: lauralucas | last post by:
Hello I'm using ASP.NET 1.1, Visual Studio 2003, IIS 5.1 and windows XP as development machine. I can work in this machine locally and create web apps that I can access via localhost. No problem...
4
by: Neil | last post by:
I work on a local copy of a database (Access 2000 MDB with ODBC linked tables to a SQL 7 database). The SQL Server db I'm working with is on my C drive (MSDE). Occasionally I'll connect to a VPN to...
10
by: Richard | last post by:
Hi folks, thanks for taking the time to read this (and hopefully point our where I'm going wrong). The scenario: I have a local Access2007 database which links in several read only mySql...
12
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i current have a way to read both local and remote machines registry keys and create a textual view (.txt output). i now looking for ways to do export of local and remote mahcine registry keys...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.