I have this problem that I have been wrestling with for awhile now. I have some data that needs to be placed in different tables in an access DB but the data has to be related to each other. For example, say I have a customer table with name and address fields and I have a purchase table with items and quantity purchased fields. What I want to be able to do using ADO and sql (without tampering with the database by using access itself, I want to do it all in code) is to be able to present the user with a form that allows them to enter the customer information as well as their order information and then the program takes this and adds it to the database in one fell swoop with a minimum of code.
I can create the database, tables and fields by using ADOX.
From what I gather I will need a way to relate the tables. So I would have to add an index to the customer table, making it look like:
custID custName custAdd orderID
And the purchases table would look like:
orderID items quant
I think that by joining the tables on the orderID I can retrieve the information easily enough. But I am stumped as how to get the information in there? The part that stumps me the most is how to get the orderID field synchronized...
Any help would be appreciated.
Troy Williams B.Eng.
fenris@hotmail.com
I can create the database, tables and fields by using ADOX.
From what I gather I will need a way to relate the tables. So I would have to add an index to the customer table, making it look like:
custID custName custAdd orderID
And the purchases table would look like:
orderID items quant
I think that by joining the tables on the orderID I can retrieve the information easily enough. But I am stumped as how to get the information in there? The part that stumps me the most is how to get the orderID field synchronized...
Any help would be appreciated.
Troy Williams B.Eng.
fenris@hotmail.com