From: Greg Campbell <greg.campbell@us.michelin.com>
To: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: basic questions with odbc and visual basic.
Date: Mon, 27 Sep 2004 14:55:28 -0400
Message-ID: <41586220.2010605@us.michelin.com> (raw)
In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB3412A74C2@Herge.rcsinc.local>
References: <6EE64EF3AB31D5448D0007DD34EEB3412A74C2@Herge.rcsinc.local>
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
>
>
Attachments:greg.campbell.vcf (text/x-vcard, 281B) download
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: greg.campbell@us.michelin.com, merlin.moncure@rcsonline.com
Subject: Re: basic questions with odbc and visual basic.
In-Reply-To: <41586220.2010605@us.michelin.com>
References: <6EE64EF3AB31D5448D0007DD34EEB3412A74C2@Herge.rcsinc.local> <41586220.2010605@us.michelin.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox