Re: basic questions with odbc and visual basic.
От | Greg Campbell |
---|---|
Тема | Re: basic questions with odbc and visual basic. |
Дата | |
Msg-id | 41586220.2010605@us.michelin.com обсуждение исходный текст |
Ответ на | basic questions with odbc and visual basic. ("Merlin Moncure" <merlin.moncure@rcsonline.com>) |
Список | pgsql-odbc |
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 > >
Вложения
В списке pgsql-odbc по дате отправления: