Personally, I only use the autoinc column for
searches, avoiding any dependencies based on it. I
generate my own index from a table (similiar to the
way  Borland's famous sample app "Mastapp" does) for
referencing by other tables. 

   Several reasons: 

   The autoinc column is generated on BeforePost.
Sometimes you want to know this index value right away
so my "homemade" index is created on AfterNewRecord. 

   Another reason is because when a "table rebuild" is
done, it reindexes the autoinc column and many records
depending on this column (like master/detail) will
then be orphaned because the foreign key reference has
changed. This is one reason why using an autoinc for
master/detail should be absolutely prohibited in my
opinion.

   I create desktop databases primarily so I don't
know how appropriate this is for client/server. I'd be
interested in what those knowledgeable have to say.

Dave

--- Philbert <[EMAIL PROTECTED]> wrote:

> I have two Access tables namely Invoices (Invoiceno,
> Invoicedate,
> Customerid) and InvoiceItems(Invoiceno, ItemNo,
> Description, Quantity,
> UnitPrice). InvoiceNo in Invoices is an autonumber.
> In my application,
> i want the number to be availed only after the user
> clicks Save button.
> As such i have used batch updates (ADO). The form
> seems to work fine
> when the user is adding the invoice items, but when
> one clicks Save,
> the invoice items disappear. The save button has two
> lines of code to
> save the changes:
> tblInvoices.UpdateBatch;
> tblInvoiceItems.UpdateBatch;
> 
> 
> My aim is to ensure that an invoice is saved as one
> unit and not saving 
> the master and the details individually. If there is
> another workaround i 
> will also appreciate.
> 
> I'm on Delphi 6.
> 
> Phil
> 
> 
> 



                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to