Re: Thank you! But how to get it working with VC++5?
От | Byron Nikolaidis |
---|---|
Тема | Re: Thank you! But how to get it working with VC++5? |
Дата | |
Msg-id | 356CB266.9A25E2D9@insightdist.com обсуждение исходный текст |
Список | pgsql-interfaces |
Hi, First of all, you probably should subscribe to the "postgres interfaces" mailing list. This way, you will find out info about the odbc driver, and new updates, etc. This is a very active thing. In fact, just today I finally got the driver working with the odbc cursor library. This will allow you to do probably what you want with the snapshot. The interfaces list is pgsql-interfaces@postgreSQL.org. To subscribe, send mail to Majordomo@hub.org with the single line "subscribe pgsql-interfaces" in the body. I'm pretty sure this is the correct syntax. Somebody please correct me if I'm wrong . Now, for your odbc questions, see below.... Nick Urbanik wrote: > We have a problem with using it under NT 4.0 with service pack 3 and > VC++5.0. The error message was apparently from the ODBC driver saying > that "Snapshot requires static cursor". > Yes, I have just today got the driver working with the odbc cursor library. Thus, it will allow static cursors regardless of the setting of the "Use Cursors" option. The odbc cursor library adds many features, such as positioned updates, static cursors, block cursors, SQLExtendedFetch, etc., which the mfc CRecordset likes to use. > For the RecordSet Type, we selected > snapshot, as opposed to dynaset. > Good. Snapshot uses static cursors, which by Friday, should be very well supported, thanks to the odbc cursor library. A snapshot basically is a picture of the result set at the time of the query -- updates by other users are not directly visible. You would have to do a requery to see them. Dynasets use "keyset driven" cursors, where as you scroll to a row, the driver retrieves the row using the key for that result set. This way, you see updates that other users have made. Keyset driven cursors are currently not supported by the driver nor the cursor library. Maybe some day. > When we deselected "Use Cursors" under the ODBC > setup, then we did not get the error message. The reason is that when "Use Cursors" is unchecked, the driver supports additional functionality, like SQLExtendedFetch and it supports a read-only static cursor, which the snapshot recordset requires. You can also use a ForwardOnly cursor, which is supported by either setting of the "Use Cursors" option. Some background on the "Use Cursors" ... when checked, the driver uses the declare/fetch cursor mechanism of Postgres to retrieve 100 rows into a cache. When the cache is depleted, it retrieves another 100. This is very efficient, fast access to the data. It is best used, however, in a read-only fashion. When the "Use Cursors" is not checked, the driver retrieves the entire result-set into its memory. This can use too much memory on big result-sets. However, since all the records are available, the driver can support a read-only static cursor and Extended fetches (first, last, forward, backward, etc.) This is why you did not get the error message when you deselected it. Note, I am changing the title of this option from "Use Cursors" to "Use Declare/Fetch", because it is too confusing with odbc scrolling cursors. When the cursor library is used, it will probably be best to set this to checked, since the cursor library caches all the rows anyway. On big result sets, it would be wasteful for both the driver and the cursor library to cache all the rows. > However, my partner, who knows much more about databases than I do, said > that without using cursors, records would be loaded one at a time, and > access would be very slow (though we did not test the speed). See above.Hopefully by Friday, the new odbc driver v.0243 which supports the cursor library will be at our website (http://www.insightdist.com/psqlodbc). Regards, Byron
В списке pgsql-interfaces по дате отправления: