Received: from secure.cybernaut.com (secure.cybernaut.com [207.33.154.240]) by hub.org (8.9.3/8.9.3) with ESMTP id UAA85941 for ; Tue, 7 Dec 1999 20:00:16 -0500 (EST) (envelope-from brian@cybernaut.com) Received: from specter (gatekeeper.fresno.cybernaut.com [24.30.110.76]) by secure.cybernaut.com (8.9.1a/8.9.1) with SMTP id RAA02681 for ; Tue, 7 Dec 1999 17:00:00 -0800 X-Authentication-Warning: secure.cybernaut.com: Host gatekeeper.fresno.cybernaut.com [24.30.110.76] claimed to be specter From: "Brian Haney" To: Subject: VBA Recordset.AddNew and NOT NULL fields Date: Tue, 7 Dec 1999 16:58:44 -0800 Message-ID: <001701bf4117$6054d9d0$8101a8c0@specter.fresno.cybernaut.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 I have a PostgreSQL (6.5.2) table "vendors" with a serial primary key "vendor_id". When I try to add a new record from VBA (under Excel 97, SR-2a) I get Run-time error 3155 ODBC -- insert on linked table '???' failed. A review of the odbc log file shows that it was trying to execute the following command: INSERT INTO "vendors" ("vendor_id","vendor_name","contact_id","vendor_addr1","vendor_addr2","vendo r_city","vendor_state","vendor_zip","vendor_country","vendor_email","vendor_ phone","vendor_fax","vendor_promo","vendor_promo_url","vendor_url","vendor_c omments","last_modified") VALUES(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL ,NULL,NULL,NULL) which of course fails since the primary key, vendor_id, cannot be null. (The failure message from PostgreSQL was: "ERROR: ExecAppend: Fail to add null value in not null attribute vendor_id".) I'm using the PostgreSQL ODBC driver 6.40.00.6 from Insight Distribution. Is it possible to configure the driver or the recordset so it will not attempt to insert a new record with all NULL values when I invoke the AddNew method? Brian Haney