Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 6D6D59FB648 for ; Wed, 7 Mar 2007 07:36:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 93538-05 for ; Wed, 7 Mar 2007 07:35:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtpout21.attiva.biz (smtpout21.attiva.biz [85.37.16.23]) by postgresql.org (Postfix) with ESMTP id 92C2A9FB61C for ; Wed, 7 Mar 2007 07:35:57 -0400 (AST) Received: from FBCMFE02B15.fbc.local ([192.168.30.161]) by smtpout21.attiva.biz with Microsoft SMTPSVC(6.0.3790.1830); Wed, 7 Mar 2007 12:35:54 +0100 Received: from dream ([88.34.161.130]) by FBCMFE02B15.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Wed, 7 Mar 2007 12:35:52 +0100 Message-ID: <003f01c760ac$c8d34980$1102a8c0@dream> Reply-To: "Shavonne Marietta Wijesinghe" From: "Shavonne Marietta Wijesinghe" To: Subject: PRIMARY KEY Date: Wed, 7 Mar 2007 12:35:58 +0100 Organization: Studio FORM MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_003C_01C760B5.28165DD0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-OriginalArrivalTime: 07 Mar 2007 11:35:52.0935 (UTC) FILETIME=[C33A0770:01C760AC] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.709 tagged_above=0 required=5 tests=AWL, BAYES_50, HTML_50_60, HTML_MESSAGE, SUBJ_ALL_CAPS X-Spam-Level: X-Archive-Number: 200703/66 X-Sequence-Number: 27704 This is a multi-part message in MIME format. ------=_NextPart_000_003C_01C760B5.28165DD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello I have created a table CREATE TABLE MOD48_00_2007 ( ID text, N_GEN int PRIMARY KEY, FORMSTORE = text, COD_NOTAIO text, PA_COGNOME text); And i insert the rows via a form in ASP. When the form loads i have a = functin that goes and gets the value of the field N_GEN adds 1 to it and = shows it to the user. The problem is when i have 2 users working at the same time. For example the last value in my field N_GEN is 2 When both the users A and B loads the form (ASP page) it sees N_GEN =3D = 3 :) So they fill in the form and user A clicks on the button OK and the = record has been inserted with N_GEN =3D 3. But when the user B clicks on = the button the record is not inserted because it has the same key "3" INSERT INTO MOD48_00_2007 (ID, N_GEN, FORMSTORE, COD_NOTAIO, PA_COGNOME) = VALUES ('192168217200737122012', '3', '', '00128', 'DE MARTINIS') Is there any way i can do this automatically? i mean maybe i have to use = someother property instead of "Primary Key" ?? Thanks Shavonne Wijesinghe ------=_NextPart_000_003C_01C760B5.28165DD0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello
 
I have created a table
CREATE TABLE MOD48_00_2007 ( ID text, = N_GEN int=20 PRIMARY KEY, FORMSTORE text, COD_NOTAIO text, PA_COGNOME = text);
 
And i insert the rows = via a form=20 in ASP. When the form loads i have a functin that goes and gets the = value=20 of the field N_GEN adds 1 to it and shows it to the=20 user.
The problem is when i = have 2 users=20 working at the same time.
 
For example the last value in my field N_GEN is=20 2
When both the users A and B loads the form (ASP = page) it=20 sees N_GEN =3D 3 :)
 
So they fill in the form and user A clicks on = the button=20 OK and the record has been inserted with N_GEN =3D 3. But when the user = B clicks=20 on the button the record is not inserted because it has the same key=20 "3"
 
INSERT INTO MOD48_00_2007 (ID, N_GEN, = FORMSTORE,=20 COD_NOTAIO, PA_COGNOME) VALUES ('192168217200737122012', '3', '', = '00128', 'DE=20 MARTINIS')
 
Is there any way i can do this automatically? i = mean maybe=20 i have to use someother property instead of "Primary Key" = ??
 
Thanks
 
Shavonne = Wijesinghe
------=_NextPart_000_003C_01C760B5.28165DD0--