Hi all,
I'm trying to open a Firebird database via ADO (I installed the trial version of IBprovider http://www.ibprovider.com/eng/download.html) but a connection error always appairs. Any ideas ?
I also tried using the tfirebird class but it seems there are problems in the table creation.
This is my code also available at www.softwarexp.co.uk/beta/adocode.zip
Any ideas appreciated . Thanks in advance.
#include "fivewin.ch"
function main
LOCAL oRs, oErr
local cConnStr := 'Provider=LCPI.IBProvider;'+;
'Password=masterkey;User ID=sysdba;auto_commit=true;'+;
'Data Source=localhost:k:\test_fb5\test.gdb;ctype=win1251'
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
*
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