logo       


Re: vb6 inquiry: msg#00092

Subject: Re: vb6 inquiry
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

Attachment: greg.campbell.vcf
Description: Vcard

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe