Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Posts
    2

    Unanswered: ado problem vb6/ingres

    I'm tring to use ado to access an ingres ii 2.5 database (solaris version) from a vb6 app. My problem is that I'm trying to do a recordset MoveFirst method, but the recordset is not allowing that because somehow the recordset.Cursortype property is getting changed to adOpenForwardOnly, even though I'm settting it to adOpenStatic in my code. It's like the adOpenStatic isn't supported by Ingres' ODBC driver, but that can't be possible, can it?

    Here's the code in question

    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Dim utilitiesDBconn As New ADODB.Connection

    utilitiesDBconn.Open "DSN=CA_med_m;uid=ingres;pwd=dbadmin"
    sql_prod = "select * from productivity"
    Dim rs As New ADODB.Recordset
    rs.CursorLocation = adUseServer
    On Error GoTo 0
    rs.Open Source:=sql_prod, _
    ActiveConnection:=utilitiesDBconn, _
    CursorType:=adOpenStatic, _
    LockType:=adLockReadOnly
    rs.MoveFirst
    rs.MoveLast
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

    changing the order of movefirst and movelast has no effect. I also tried adOpenDynamic and adOpenKeySet, but no matter what I set it at, in debug mode, if I "print rs.CursorType" 0 gets printed, which is adOpenForwardOnly.

    I'm actually converting a DAO application to ADO, and it was working fine under DAO, so I'm pretty sure that means that the ODBC driver DOES support cursors other than forward only.

    Greg

  2. #2
    Join Date
    Feb 2003
    Location
    Montreal, Canada
    Posts
    117

    Re: ado problem vb6/ingres

    As far as I can see your ar trying to set the cursor type after the cursor opening.
    You should do that before like:

    Dim rs As New ADODB.Recordset
    rs.CursorLocation = adUseServer
    rs.CursorType:=adOpenDynamic
    rs.ActiveConnection:=utilitiesDBconn

    rs.open sql_prod
    rs.MoveFirst
    :
    rs.MoveLast

    Cheers

    Originally posted by gadams00
    I'm tring to use ado to access an ingres ii 2.5 database (solaris version) from a vb6 app. My problem is that I'm trying to do a recordset MoveFirst method, but the recordset is not allowing that because somehow the recordset.Cursortype property is getting changed to adOpenForwardOnly, even though I'm settting it to adOpenStatic in my code. It's like the adOpenStatic isn't supported by Ingres' ODBC driver, but that can't be possible, can it?

    Here's the code in question

    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Dim utilitiesDBconn As New ADODB.Connection

    utilitiesDBconn.Open "DSN=CA_med_m;uid=ingres;pwd=dbadmin"
    sql_prod = "select * from productivity"
    Dim rs As New ADODB.Recordset
    rs.CursorLocation = adUseServer
    On Error GoTo 0
    rs.Open Source:=sql_prod, _
    ActiveConnection:=utilitiesDBconn, _
    CursorType:=adOpenStatic, _
    LockType:=adLockReadOnly
    rs.MoveFirst
    rs.MoveLast
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

    changing the order of movefirst and movelast has no effect. I also tried adOpenDynamic and adOpenKeySet, but no matter what I set it at, in debug mode, if I "print rs.CursorType" 0 gets printed, which is adOpenForwardOnly.

    I'm actually converting a DAO application to ADO, and it was working fine under DAO, so I'm pretty sure that means that the ODBC driver DOES support cursors other than forward only.

    Greg
    Steve

  3. #3
    Join Date
    Apr 2003
    Posts
    2

    actually

    it turns out that I needed to change the cursorLocation of the connection, not the recordset.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •