473,513 Members | 2,440 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADO / DAO Syntax to write to external database

I need to go over the hurdle of the connectivity syntax of ADO vs DAO.

I want to loop thru each record of table "A" in the current
database "X"

If condition is true in field "Y"
modify field "Z"
Append this record and all its fields to table "B"

Else
Ditto to table "C" in an external Database.

Endif

Thank you for showing me both versions ADO & DAO.

Wayne collins

Nov 13 '05 #1
1 2220
One might call this ADO:

CurrentProject.Connection.Execute "UPDATE Transactions SET
Amount=Amount*-1 WHERE Day([Date])=13"
---------------------------------
One might call this DAO:

DBEngine(0)(0).Execute "INSERT INTO " _
& "[C:\Documents and Settings\Lyle Fairfield\My
Documents\Access\terrawaretables2.mdb].[transactions] " _
& "SELECT Date ,Account, Method, Details, Amount,Currency FROM
transactions WHERE Day([Date])=13"

CurrentProject.Connection.Execute
and
DBEngine(0)(0).Execute
are interchangeable, assuming references are correct.

In general, one does not use recordsets when one can use SQL.

Nov 13 '05 #2

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

Similar topics

29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
8
3300
by: Jan van Veldhuizen | last post by:
The UPDATE table FROM syntax is not supported by Oracle. I am looking for a syntax that is understood by both Oracle and SqlServer. Example: Table1: id name city ...
17
1905
by: Paul | last post by:
HI! I am trying to dynamically add content into Div tags with the use of JavaScript. it loads the page but adds a few characters. the script is below. <script language="JavaScript">...
8
4318
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
4
3899
by: Danny W | last post by:
Hi There! Is it possible to use HttpModule to replace the built-in ASP.NET Session object? I want to write a HttpModule that will handle storing and retrieving of session values from an external...
2
2233
by: Matthew Wells | last post by:
Hello, I have an ADO connection object connected to an external ms access password protected database. I am trying to execute a delete statement from that object on a table in my currentdb. ...
13
3004
by: usenet | last post by:
How and where can one find out about the basics of VB/Access2003 syntax? I am a died in the wool C/C++/Java Linux/Unix programmer and I am finding it difficult to understand the program format...
4
2606
by: jelle | last post by:
Hi, I use python quite a bit to couple different programs together. Doing so has been a _lot_ easier since subprocess came around, but would really like to be able to use the succinct shell...
0
7386
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,...
1
7106
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5689
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,...
1
5094
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...
0
4749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3236
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.