X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C21C9329F48 for ; Mon, 27 Sep 2004 19:55:42 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92577-10 for ; Mon, 27 Sep 2004 18:55:36 +0000 (GMT) Received: from gk-us2.michelin.com (gk-us2.michelin.com [156.65.14.19]) by svr1.postgresql.org (Postfix) with ESMTP id 7DA39329F42 for ; Mon, 27 Sep 2004 19:55:35 +0100 (BST) Received: from ONCMH1.onc.michelin.com (unverified) by gk-us2.michelin.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Mon, 27 Sep 2004 14:48:25 -0400 Received: from oncmtap1.onc.michelin.com by oncmh1.onc.michelin.com with ESMTP for pgsql-odbc@postgresql.org; Mon, 27 Sep 2004 14:51:01 -0400 Received: from oncems01.onc.michelin.com ([156.65.125.150]) by oncmtap1.onc.michelin.com (Netscape Messaging Server 4.15) with ESMTP id I4PR8I00.JEP for ; Mon, 27 Sep 2004 14:55:30 -0400 Received: from us.michelin.com (unverified) by oncems01.onc.michelin.com (Content Technologies SMTPRS 4.2.5) with ESMTP id ; Mon, 27 Sep 2004 14:55:29 -0400 Message-Id: <41586220.2010605@us.michelin.com> Date: Mon, 27 Sep 2004 14:55:28 -0400 From: "Greg Campbell" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Merlin Moncure Cc: pgsql-odbc@postgresql.org Subject: Re: basic questions with odbc and visual basic. References: <6EE64EF3AB31D5448D0007DD34EEB3412A74C2@Herge.rcsinc.local> In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB3412A74C2@Herge.rcsinc.local> Content-Type: multipart/mixed; boundary="------------060904090000050903050204" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_RFCI X-Spam-Level: X-Archive-Number: 200409/71 X-Sequence-Number: 4446 This is a multi-part message in MIME format. --------------060904090000050903050204 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I have done a fair amount with VB and PostgreSQL ODBC and I am perplexed by what you have described as your problem. You make it sound as it VB is "making up" the SQL statements to send. My update sections, typically look like: Dim cnn as connection Dim sql_str as string cnn.Open "my_datasource_specificatin_goes_here" sql_str = "UPDATE t set f1=a WHERE f2=c" cnn.Execute sql_str cnn.Close set cnn = Nothing Of course, my SQL strings are usually a complex concatention of variables and such. This is practically a pass-through query. Logging on the client and server should verify this. Did you leave out some information, like you are using a bound data control perhaps? You mentioned Access. I could say look for the abundant information on Access issues. If you are trying to update from data table view in Access -- I suggest make sure you have a primary key on your server table, turn row-versioning on in the PostgreSQL driver. Try it on a table with OIDs and without OIDs to see if it makes a difference for you. This only applies to data table view. Updating in code modules is a programmer issue about using ADO. Merlin Moncure wrote: >Hello, > >I have some basic questions regarding visual basic and odbc. So far, >I've been having problems getting Visual Basic/Access to write data back >to my database via odbc. Normally I use Delphi for this type of thing, >but some of our clients are insisting on vb 6.0 access. > >The biggest problem I have is that updating data from a VB app always >fails...the problem is that at update time ADO builds a where clause >containing every field in the table, not just the primary key. >Invariably, this causes the update to not to work. If I have some type >of integer primary key for my table is there some way of forcing the >driver row resolution to write queries in the form of > >update t set [] where f = k? > >instead of > >update t set [] where f1 = a, f2 = b, f3 = c [...] for all the fields in >t? > > >Merlin > > > > >---------------------------(end of broadcast)--------------------------- >TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > > --------------060904090000050903050204 Content-Type: text/x-vcard; charset=utf8; name="greg.campbell.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="greg.campbell.vcf" begin:vcard fn:Greg Campbell n:Campbell;Greg org:Michelin North America;ENG-IT adr;dom:;;2420 Two Notch Road;Lexington;SC;29071 email;internet:greg.campbell@us.michelin.com title:Systems Engineer tel;work:803-951-5561 tel;fax:803-951-5531 x-mozilla-html:FALSE version:2.1 end:vcard --------------060904090000050903050204--