Firebird and Ado

Firebird and Ado

Postby Marco Turco » Thu Dec 24, 2009 10:12 am

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
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Firebird and Ado

Postby Armando » Thu Dec 24, 2009 3:31 pm

Marco:

Try with these connection strings.

http://www.connectionstrings.com/firebird

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3217
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests