X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A30E6D6F03 for ; Mon, 17 Oct 2005 09:59:43 -0300 (ADT) 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 73781-08 for ; Mon, 17 Oct 2005 12:59:37 +0000 (GMT) Received: from gk-us2.us.michelin.com (gk-us2.michelin.com [156.65.14.19]) by svr1.postgresql.org (Postfix) with ESMTP id 0AA1FD6FB5 for ; Mon, 17 Oct 2005 09:59:38 -0300 (ADT) Received: from oncpfxp4-out.onc.michelin.com (unverified [10.21.4.32]) by gk-us2.us.michelin.com (Clearswift SMTPRS 5.1.4) with ESMTP id for ; Mon, 17 Oct 2005 08:59:03 -0400 Received: from ONCMH1.onc.michelin.com (ONCMH1.onc.michelin.com [156.65.124.40]) by oncpfxp4-out.onc.michelin.com (Postfix) with ESMTP id 54FE316E52 for ; Mon, 17 Oct 2005 08:59:36 -0400 (EDT) Received: from oncmtap1.onc.michelin.com by oncmh1.onc.michelin.com with ESMTP for pgsql-odbc@postgresql.org; Mon, 17 Oct 2005 08:59:35 -0400 Received: from oncems01.onc.michelin.com ([156.65.125.150]) by oncmtap1.onc.michelin.com (Netscape Messaging Server 4.15) with ESMTP id IOI9FB00.Q1Y for ; Mon, 17 Oct 2005 08:59:35 -0400 Received: from [10.43.12.183] (unverified) by oncems01.onc.michelin.com (Content Technologies SMTPRS 4.2.5) with ESMTP id ; Mon, 17 Oct 2005 08:59:34 -0400 Message-Id: <4353A033.6070502@us.michelin.com> Date: Mon, 17 Oct 2005 08:59:31 -0400 From: "Greg Campbell" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joseph Armbruster Cc: pgsql-odbc@postgresql.org Subject: Re: vb6 inquiry References: <938f42d70510121234m121a622ahe934c1ea9c22587d@mail.gmail.com> In-Reply-To: <938f42d70510121234m121a622ahe934c1ea9c22587d@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------050106030805060104030306" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.021 required=5 tests=[AWL=0.021] X-Spam-Level: X-Archive-Number: 200510/94 X-Sequence-Number: 6196 This is a multi-part message in MIME format. --------------050106030805060104030306 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I was under the impression that psqlODBC does not support server side cursors. Therefore the correct way to retrieve data is to use a client side cursor (adUseClient). This is inline with a "disconnected" model that returns all the requested records immediately, instead of waiting for the client to cursor through them. This also is supposed to allow a more immediate release of the connection, ultimately providing greater scalability. (Is scalability still a buzz-word?). BTW your sample specifies a LockType in two places. It's ok, but you don't really need that. I think the one on the rs.Open line is good enough. Note: adUseServer=2 adUseClient=3 Joseph Armbruster wrote: > All, > > I am working off of the vb6 sample given in the psqlODBC doc that > accompanies the odbc driver. My issue is, when I am displaying the > rs.Cursortype, it is reading 3, however this is not what was requested. > Shouldn't this be 2? > > Thank You, > Joseph Armbruster > > Dim cn As New adodb.Connection > Dim rs As New adodb.Recordset > > cn.Open "DSN=test_post;UID=postgres;PWD=acupostgres;Database=vbtest" > > rs.CursorType = adOpenDynamic > rs.LockType = adLockOptimistic > rs.CursorLocation = adUseServer > rs.Open "SELECT id, data FROM vbtest", cn, adOpenDynamic, adLockOptimistic > > MsgBox "AdoEnums.CursorType.DYNAMIC = " & adodb.CursorTypeEnum.adOpenDynamic > MsgBox "rs.CursorType = " & rs.CursorType & vbCrLf & "rs.CursorLocation = " > & rs.CursorLocation > > While Not rs.EOF > Debug.Print rs!id & ": " & rs!Data > rs.MoveNext > Wend > > rs.AddNew > rs!id = 76 > rs!Data = "More random data" > > rs.Update > > cn.Execute "INSERT INTO vbtest (id, data) VALUES (23, 'Some random data');" > rs.Update > > > If rs.State <> adStateClosed Then rs.Close > Set rs = Nothing > If cn.State <> adStateClosed Then cn.Close > Set cn = Nothing > --------------050106030805060104030306 Content-Type: text/x-vcard; charset=utf-8; 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 - US5 Lexington;ENG-ASE email;internet:greg.campbell@us.michelin.com title:ASE Systems Engineer tel;work:803-951-5561/x75561 x-mozilla-html:FALSE version:2.1 end:vcard --------------050106030805060104030306--