Hi Jeff,
So far this is what I've managed to cook up and some steps that I took in getting there.
1.
Download and install
Firebird server 2.0 series.
2.
Download the free version of ADO driver from
IBProvider
(NOTE: The free version supports up to Firebird 2.0 series only. Later versions require the commercial driver. See the list of differences
here).
3. Finally FWH code that I use to do minor test.
#include "Fivewin.ch"
#include "Tcbrowse.ch"
//-------------
FUNCTION MAIN()
LOCAL oRs, oErr
local cConnStr := 'Provider=LCPI.IBProvider.3.Free;'+;
'Password=masterkey;User ID=sysdba;auto_commit=true;'+;
'Data Source=localhost:c:\employee.fdb;ctype="";dbclient_library=""'
local oCon := CreateObject("ADODB.Connection")
oCon:ConnectionString := cConnStr
TRY
oCon:Open()
CATCH
ShowAdoError(oCon)
RETURN NIL
END TRY
oRs := CreateObject('ADODB.RecordSet')
oRs:CursorLocation := 3
TRY
*oCon:BeginTrans()
oRs:Open("SELECT CUSTOMER FROM CUSTOMER", oCon, 1, 3)
*oCon:CommitTrans()
CATCH
ShowADOError(oCon)
END
msginfo("about to view")
? ors:fields("CUSTOMER"):value
WBROWSERECORDSET( oRs )
TCBROWSERECORDSET( oRs )
oRs:Close()
oCon:close()
RETURN NIL
STATIC FUNCTION WBROWSERECORDSET( oRs )
LOCAL oDlg, oBrw, nRec
DEFINE DIALOG oDlg SIZE 300, 300
@ 0, 0 LISTBOX oBrw FIELDS oRs:Fields( "CUSTOMER" ):Value;
HEADERS "CLIENTI";
ON RIGHT CLICK ( nRec := oRs:AbsolutePosition,;
oBrw:Report( "TWBrowse report", .T. ),;
oRs:MoveFirst(),;
oRs:Move( nRec - 1 ) )
oBrw:bLogicLen = { || oRs:RecordCount }
oBrw:bGoTop = { || oRs:MoveFirst() }
oBrw:bGoBottom = { || oRs:MoveLast() }
oBrw:bSkip = { | nSkip | Skipper( oRs, nSkip ) }
oBrw:cAlias = "ARRAY"
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
RETURN NIL
STATIC FUNCTION TCBROWSERECORDSET( oRs )
LOCAL oDlg, oBrw, oCol, nRec
DEFINE DIALOG oDlg SIZE 300, 300
@ 0, 0 BROWSE oBrw;
ON RIGHT CLICK ( nRec := oRs:AbsolutePosition,;
oBrw:Report( "TWBrowse report", .T. ),;
oRs:MoveFirst(),;
oRs:Move( nRec - 1 ) )
ADD COLUMN TO oBrw;
DATA oRs:Fields( "customer" ):Value;
HEADER "CLIENTI"
oBrw:lCellStyle = .T.
oBrw:bLogicLen = { || oRs:RecordCount }
oBrw:bGoTop = { || oRs:MoveFirst() }
oBrw:bGoBottom = { || oRs:MoveLast() }
oBrw:bSkip = { | nSkip | Skipper( oRs, nSkip ) }
oBrw:cAlias = "ARRAY"
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
RETURN NIL
STATIC FUNCTION SKIPPER( oRs, nSkip )
LOCAL nRec := oRs:AbsolutePosition
oRs:Move( nSkip )
IF oRs:EOF; oRs:MoveLast(); ENDIF
IF oRs:BOF; oRs:MoveFirst(); ENDIF
RETURN oRs:AbsolutePosition - nRec
STATIC FUNCTION ShowAdoError(oCon)
LOCAL nAdoErrors := 0
LOCAL oAdoErr
nAdoErrors := oCon:Errors:Count()
IF nAdoErrors > 0
oAdoErr := oCon:Errors(nAdoErrors-1)
msginfo( oAdoErr:Description + CRLF + oAdoErr:Source )
ELSE
msginfo( 'Not Oracle Error' )
ENDIF
RETURN nil
There are a few ADO stuffs that I collected from the forum and posted it in one place here (
http://wiki.fivetechsoft.com/doku.php?i ... ted_stuffs)