Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Using ADO from Excel form to relational Access Db

Hello all:
I successfully use ADO to upload form data from an Excel spreadsheet
to an Access db but would now like to take it to a new level: Instead
of opening just one single table, I would like to add information to
other tables. For example, part of the spreadsheet would upload to an
ORDER_HEADER Table and another part of the same spreadsheet would
upload order details to the ORDER_DETAIL Table. These two tables are
related of course. My thought is: establish the value of the primary
key in the first part of the upload then use that value obtained to
open another table and upload with that primary key value.
I think the concept is valid but the details are elusive. Havent
seen any postings covering relational input. Any info on this subject
appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Using ADO from Excel form to relational Access Db

Your plan is sound. The trick is how are you generating the key? If you are
using auto number in your Access DB then you just need to read (query) that
value back once you have written the info to the DB. To query back that
record I tend to write both my NT username into the database along with a
time stamp. Additional to making a nice audit trail it allows me to query
back the last record I wrote. Knowing that you just need to use it to write
to your details table. Nice and simple(ish).

If however your key is based on one or more fields in a record then it is
even easier as you do not have to read back the key value.

Often the biggest trick is to avoid writing duplicate records into your
tables. That one depends entirely on your circumstances though...
--
HTH...

Jim Thomlinson


"bluegrassstateworker" wrote:

Hello all:
I successfully use ADO to upload form data from an Excel spreadsheet
to an Access db but would now like to take it to a new level: Instead
of opening just one single table, I would like to add information to
other tables. For example, part of the spreadsheet would upload to an
ORDER_HEADER Table and another part of the same spreadsheet would
upload order details to the ORDER_DETAIL Table. These two tables are
related of course. My thought is: establish the value of the primary
key in the first part of the upload then use that value obtained to
open another table and upload with that primary key value.
I think the concept is valid but the details are elusive. Havent
seen any postings covering relational input. Any info on this subject
appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Using ADO from Excel form to relational Access Db

In these kinds of situations, you will often times need to look at
transactions. For addtional information on this, you can go into Access's
help file and look up the "About batch transactions", and go from there.
You can also setup links within the front end portion of an Access database
(provided you have and you should split the database into 2 parts, back end
and front end), so as you can stay within Access to use the batch
transaction tools. This will help keep your data validated should something
happen in between the start of transfer time and end of transfer time, so as
you don't have orphaned data or some other issue of data missing.

Sincerely,

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000

"bluegrassstateworker" wrote in message
...
Hello all:
I successfully use ADO to upload form data from an Excel spreadsheet
to an Access db but would now like to take it to a new level: Instead
of opening just one single table, I would like to add information to
other tables. For example, part of the spreadsheet would upload to an
ORDER_HEADER Table and another part of the same spreadsheet would
upload order details to the ORDER_DETAIL Table. These two tables are
related of course. My thought is: establish the value of the primary
key in the first part of the upload then use that value obtained to
open another table and upload with that primary key value.
I think the concept is valid but the details are elusive. Havent
seen any postings covering relational input. Any info on this subject
appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Using ADO from Excel form to relational Access Db

If the primary key is an AutoNumber, you can also use @@Identity.

Jet OLE DB Provider Version 4.0 Supports SELECT @@Identity
http://support.microsoft.com/default...b;en-us;232144


--
Tim Zych
SF, CA

"bluegrassstateworker" wrote in message
...
Hello all:
I successfully use ADO to upload form data from an Excel spreadsheet
to an Access db but would now like to take it to a new level: Instead
of opening just one single table, I would like to add information to
other tables. For example, part of the spreadsheet would upload to an
ORDER_HEADER Table and another part of the same spreadsheet would
upload order details to the ORDER_DETAIL Table. These two tables are
related of course. My thought is: establish the value of the primary
key in the first part of the upload then use that value obtained to
open another table and upload with that primary key value.
I think the concept is valid but the details are elusive. Havent
seen any postings covering relational input. Any info on this subject
appreciated.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using ADO from Excel form to relational Access Db

Hi Andy,
I'm new to excel programming.
I got similar task to do but don't know from where to start.
It would be great if you help me out by sending the sample code which
you used.
Thanks in advance.

Regards,
Abhilash

On Feb 9, 12:12*am, bluegrassstateworker
wrote:
Hello all:
I successfully use ADO to upload form data from an Excel spreadsheet
to an Access db but would now like to take it to a new level: *Instead
of opening just one single table, I would like to add information to
other tables. *For example, part of the spreadsheet would upload to an
ORDER_HEADER Table and another part of the same spreadsheet would
upload order details to the ORDER_DETAIL Table. *These two tables are
related of course. *My thought is: establish the value of the primary
key in the first part of the upload then use that value obtained to
open another table and upload with that primary key value.
* * *I think the concept is valid but the details are elusive. *Havent
seen any postings covering relational input. *Any info on this subject
appreciated.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Relational Mapping Pattern for Excel/Relational DB Gary F Excel Programming 0 October 10th 06 09:27 PM
Excel as relational database - data rows AndyLucia Excel Worksheet Functions 1 March 20th 06 08:09 PM
what exactly are relational operators in Excel? All math symbol? JC Excel Worksheet Functions 7 August 22nd 05 12:31 PM
Add a value from Excel to a form in access Kevbrad1 Excel Programming 1 May 16th 05 08:36 PM
Is Relational Hierarchy Possible with Excel addi Excel Programming 4 June 23rd 04 04:15 AM


All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"