Re: ADO From Fortran - Opening Recordsets?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Robin (msrado_at_yahoo.com)
Date: 08/30/04


Date: 30 Aug 2004 05:26:33 -0700

Hi Jugoslav,

Somehow, I never thought of you as a "poor Fortraneer"! :-) Thanks for
sending this on to the ADO group and for looking into the problem.

Regards,
Robin

"Jugoslav Dujic" <jdujic@yahoo.com> wrote in message news:<2p88kdFhq1feU1@uni-berlin.de>...
> Robin wrote:
> | Hello everyone,
> |
> | I am trying to use ADO from Compaq Visual Fortran v6.1. I have
> | created a Fortran ADO module with the Fortran Module Wizard and have
> | some base code that compiles and links. When running the code, my ADO
> | connection and recordset are created without errors. The connection
> | opens without errors. But when I try to use the $Recordset_Open
> | subroutine, I get an unknown status code (-2147352567).
>
> "Error lookup" CVF utility says it's
>
> -2147352567 = 0x80020009 = "An exception ocurred"
>
> which does not tell much either.
>
> But you're really expecting too much from us poor Fortraneers. I'm
> X-posting this to ADO group -- maybe someone could tell you more.
>
> | Does anyone know what I'm doing wrong? The code is below:
> |
> | program main
> | USE DFWIN
> | USE DFLIB
> | USE TestADO
> | USE DFCOM
> | USE DFAUTO
> | USE DFCOMTY
> | USE RTObjs
> | implicit none
> | C
> | C VARIABLES
> | INTEGER*4 STATUS
> | integer*4 aa
> | integer*4 iStatic
> | integer*4 iReadOnly
> | integer*4 iCmd
> | TYPE (VARIANT) :: vBSTR1
> | TYPE (VARIANT) :: vCONINT
> |
> | C INITIALIZE OBJECT POINTERS
> | CALL INITOBJECTS()
> | C
> | C CREATE ADO Connection
> | CALL COMINITIALIZE(STATUS)
> | CALL COMCREATEOBJECT("ADODB.Connection", ADOConn, status)
> | IF(ADOConn.eq.0)then
> | write(6,*)"Cannot connect to ADO connection object."
> | goto 999
> | endif
> | c
> | c create ADO recordset
> | CALL COMCREATEOBJECT("ADODB.Recordset", ADORecSet, status)
> | if(ADORecSet.eq.0)then
> | write(6,*)"Cannot connect to ADO recordset object."
> | goto 999
> | endif
> | c
> | c open ado connection
> | call $Connection_Open(ADOConn,"Driver={SQL
> | Server};Server=SERVER
> | *;Database=DBName;Network=DBMSSOCN;", "User", "password", 0,
> | *STATUS)
> | c
> | c open recordset
> | C FIRST SET UP BSTR1 = SQL QUERY
> | CALL VariantInit(vBSTR1)
> | vBSTR1%VT = VT_BSTR
> | bstr1 = ConvertStringToBSTR('SELECT * FROM TableName')
> | vBSTR1%VU%PTR_VAL = bstr1
> | C NEXT SET UP ADOCONN VARIANT
> | CALL VariantInit(vCONINT)
> | vCONINT%VT = VT_I4
> | vCONINT%VU%LONG_VAL = ADOConn
> | C
> | iStatic = adOpenStatic
> | iReadOnly = adLockReadOnly
> | iCmd = adCmdTable
> | call $Recordset_Open(ADORecSet, vBSTR1, vCONINT,
> | *iStatic, iReadOnly, iCmd, STATUS)
> | if(status.ne.adStatusOK)then
> | write(6,*)"Can't open recordset",STATUS
> | goto 999
> | else
> | write(6,*)ADORecSet!Teeth
> | endif
> | 999 read(5,*)aa
> | continue
> | end
> |
> | Many thanks in advance!
> | Robin



Relevant Pages

  • Re: ADO From Fortran - Opening Recordsets?
    ... | I am trying to use ADO from Compaq Visual Fortran v6.1. ... | created a Fortran ADO module with the Fortran Module Wizard and have ... | C CREATE ADO Connection ...
    (comp.lang.fortran)
  • Re: ADO From Fortran - Opening Recordsets?
    ... | I am trying to use ADO from Compaq Visual Fortran v6.1. ... | created a Fortran ADO module with the Fortran Module Wizard and have ... | C CREATE ADO Connection ...
    (microsoft.public.vb.database.ado)
  • Re: ADO From Fortran - Opening Recordsets?
    ... sending this on to the ADO group and for looking into the problem. ... > Robin wrote: ... > | created a Fortran ADO module with the Fortran Module Wizard and have ... > | C CREATE ADO Connection ...
    (comp.lang.fortran)
  • ADO From Fortran - Opening Recordsets?
    ... I am trying to use ADO from Compaq Visual Fortran v6.1. ... created a Fortran ADO module with the Fortran Module Wizard and have ... C CREATE ADO Connection ...
    (comp.lang.fortran)
  • Re: ADO with Websnap in Delphi6
    ... OLEDB defines data source and ... ADO connection corresponds to OLEDB session, ...
    (borland.public.delphi.database.ado)