473,386 Members | 1,821 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,386 software developers and data experts.

Update remote table from local table

Greetings -
I'm using an Access front end to a SQL Server (2000) databas*e. Via
several steps, I create a temp table and manipulate the data* in it.
I
want to update the backend with this new data but my UPDATE *query
fails
as my temp table is local and the SQL database doesn't know *about it.

There are no linked tables in the FE database.
I have the following (DAO):
Set Db = CurrentDb
Set Qdf = Db.CreateQueryDef(TMP_QUERY_NAME)
Qdf.connect = ConnectString()
sqlString = "UPDATE tblRemote " & _
"SET " & _
"tblRemote.Some_Foo = tblLocal.Foo, " & _
"FROM tblRemote INNER JOIN tblLocal " & _
"ON tblRemote.Some_ID = tblLocal.Some_ID;"
Qdf.sql = sqlString
Qdf.ReturnsRecords = False
Qdf.Execute dbFailOnError
Is there any way of doing this without adding a linked table*?
Thanks,
chris

Jul 23 '05 #1
2 3220
When you say there are no linked tables in the FE, how are you
transfering the data from the back end to the front? After all,
wouldn't tblRemote have to be a link table itself? You are connecting
to the current access database to update the rows and if this table is
not a link table then you cannot update it on the sql server.

If you do not want a link table then you will need to create a new
connection to the SQL Server, retrieve the information from tblLocal
into a recordset and build and execute an update on the SQL Server for
each record in your set.

--
David Rowland
MS SQL Server DBMonitor author
http://dbmonitor.tripod.com

Jul 23 '05 #2
On Sun, 30 Jan 2005 19:57:08 -0500, dbmonitor wrote
(in article <11**********************@z14g2000cwz.googlegroups .com>):
When you say there are no linked tables in the FE, how are you
transfering the data from the back end to the front? After all,
wouldn't tblRemote have to be a link table itself? You are connecting
to the current access database to update the rows and if this table is
not a link table then you cannot update it on the sql server.

Hi -

Thanks for the reply. I'm not using linked tables, I only connect (via code)
when necessary via the .Connect property of the Querydef object.
If you do not want a link table then you will need to create a new
connection to the SQL Server, retrieve the information from tblLocal
into a recordset and build and execute an update on the SQL Server for
each record in your set.


I'll give this a try, might you have some example code? It can be in any
language. Thanks.

--chris

Jul 23 '05 #3

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

Similar topics

2
by: addi | last post by:
All, Can someone help me with the following SQL and help me write it in an OPENQUERY format. I am running the following code from a SQL Server 7 box, trying to update a table in an Oracle Linked...
3
by: markydev | last post by:
Hi, I'm using sql server 2000 sp4. I've 2 databases linked, an instance and my local. I'm getting two different errors when trying to update the remote table (local server) from the instance....
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...
6
by: Access Newbie | last post by:
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...
5
by: Sadun Sevingen | last post by:
hi i get dataset from'an webservice so i don't have an adaptor... dataset's structure is same as mine database table.... how can i update database table according to dataset...
0
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database...
3
by: Pakna | last post by:
Hello, I have what may be a beginner's question regarding DB2. How does one access a remote table on a remote database via SQL? What is the command string, is there an equivalent of Oracle...
2
by: benfly08 | last post by:
Hi, Folks. I got a scenario that cause me headache. Currently our company is using an AS/400 Server which run DB2 to hold all critical data(I called it remote site). I dont' have acess...
1
by: rshivaraman | last post by:
Hi All I am updating a local table based on inner join between local table and remote table. Update LocalTable SET Field1 = B.Field1 FROM LinkedServer.dbname.dbo.RemoteTable B INNER JOIN...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.