Thread View: borland.public.cppbuilder.database.multi-tier
4 messages
4 total messages
Started by Tom Barfoot
Tue, 25 Jan 2000 00:00
DB "KEY" problems ... Multi-tier
Author: Tom Barfoot
Date: Tue, 25 Jan 2000 00:00
Date: Tue, 25 Jan 2000 00:00
11 lines
957 bytes
957 bytes
I can't solve the problem of doing an insert into my table which has the first field as an AUTOINCREMENT field, and is the primary key. I get the error message "Field value is required". Is there any good reading material or other information that would explain how to deal with the "keys" (and generation of the keys) on a table using the 3 tier model ? Any help would be appreciated. -- Tom Barfoot
Re: DB "KEY" problems ... Multi-tier
Author: Mark Cashman (TeamB BCB)
Date: Tue, 25 Jan 2000 00:00
Date: Tue, 25 Jan 2000 00:00
20 lines
1223 bytes
1223 bytes
Hi, Tom! In almost every case it is far better to avoid use of autoincrement and generate your keys from a table in the database. Have a look at http://www.temporaldoorway.com/programming/cbuilder/databaseandbde/generateuniqueid.htm for details on how to accomplish this. ------ Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at http://www.temporaldoorway.com - Original digital art, writing, music and more - C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring (Join us!) http://www.temporaldoorway.com/programming/index.htm ------
Re: DB "KEY" problems ... Multi-tier
Author: Harold Howe (TeamB)
Date: Mon, 31 Jan 2000 00:00
Date: Mon, 31 Jan 2000 00:00
15 lines
1241 bytes
1241 bytes
Tom Barfoot wrote: > > I can't solve the problem of doing an insert into my table which has the > first field as an AUTOINCREMENT field, and is the primary key. I get the > error message "Field value is required". Do you have persistent fields in the fields editor? If so, then go to this autoinc field and make sure that Required is set to false. When you post a record, the VCL loops through each field and checks to make sure that all required fields have been entered. The autoinc field should not be entered by the user, so Required should be false. Of course, on the database end, the field is required. But that's ok. Harold Howe [TeamB] http://www.bcbdev.com
Re: DB "KEY" problems ... Multi-tier
Author: L Rotger
Date: Fri, 04 Feb 2000 00:00
Date: Fri, 04 Feb 2000 00:00
23 lines
1225 bytes
1225 bytes
Hi,
Having looked at the code on that page, I wonder if it implicitly locks
the row so no other processes can access it while you store the id, add one
and store it back on the table. I always send passthrough SQL to the server.
I don't know if this code would be enough.
Lucy
Mark Cashman (TeamB BCB) escribi๏ฟฝ en mensaje
<388E771E.394138F6@ix.netcom.com>...
>Hi, Tom!
>
>In almost every case it is far better to avoid use of autoincrement and
>generate your keys from a table in the database.
>
>Have a look at
>
>
>http://www.temporaldoorway.com/programming/cbuilder/databaseandbde/generate
uniqueid.htm
>
>for details on how to accomplish this.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads