FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Urgent: How Open a Firebird
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Urgent: How Open a Firebird
Posted: Fri Sep 26, 2008 08:37 AM

I must open a fdb archive and list the structure of each table
How I can make it ?

Can I have a small sample pls. ?

Best Regards, Saludos



Falconi Silvio
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Urgent: How Open a Firebird
Posted: Fri Sep 26, 2008 09:29 AM

Silvio,

You may use ADO to open and manage it.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Urgent: How Open a Firebird
Posted: Fri Sep 26, 2008 09:49 AM

on the same mode I open MDB access file ?
thanks I try now

to print each structure table
wich is the command ?

Best Regards, Saludos



Falconi Silvio
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Urgent: How Open a Firebird
Posted: Fri Sep 26, 2008 10:57 AM
Silvio wrote:to print each structure table
wich is the command ?


FUNCTION MAIN()

    LOCAL oCat

    LOCAL i, j

    oCat = CREATEOBJECT( "ADOX.Catalog" )

    oCat:ActiveConnection = "Your connection string"

    FOR i = 0 TO oCat:Tables:Count() - 1
        ? oCat:Tables( i ):Name
        ?

        FOR j = 0 TO oCat:Tables( i ):Columns:Count() - 1
            ? SPACE( 4 ),;
              PADR( oCat:Tables( i ):Columns( j ):Name, 20 ),;
              STR( oCat:Tables( i ):Columns( j ):Type, 5 ),;
              STR( oCat:Tables( i ):Columns( j ):DefinedSize, 10 ),;
              STR( oCat:Tables( i ):Columns( j ):Precision, 5 )
        NEXT

        ?
    NEXT

    RETURN NIL


EMG
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Urgent: How Open a Firebird
Posted: Fri Sep 26, 2008 03:14 PM

thanks emg,

Best Regards, Saludos



Falconi Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Urgent: How Open a Firebird
Posted: Fri Sep 26, 2008 03:41 PM

It give me error

Application

Path and name: C:\work\prg\firebird\test.Exe (32 bits)
Size: 1,311,744 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 09/26/08, 17:42:11
Error description: Error ADOX.Catalog/16389 E_FAIL: _ACTIVECONNECTION
Args:
[ 1] = C Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.fdb;User Id=admin;Password=bpteramo;

Stack Calls

Called from: win32ole.prg => TOLEAUTO:_ACTIVECONNECTION(0)
Called from: test.prg => MAIN(45)

Best Regards, Saludos



Falconi Silvio
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Urgent: How Open a Firebird
Posted: Fri Sep 26, 2008 03:50 PM

There is a sample Firebird connection string on this page:

http://www.connectionstrings.com/?carrier=firebird

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Urgent: How Open a Firebird
Posted: Sat Sep 27, 2008 12:32 AM

i try with Driver=Firebird/InterBase(r) driver;Uid=SYSDBA;Pwd=masterkey;DbName=TEST.FDB;

but it make the same error

Best Regards, Saludos



Falconi Silvio
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Urgent: How Open a Firebird
Posted: Sat Sep 27, 2008 05:42 AM

You have to use your own user ID and password.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
Re: Urgent: How Open a Firebird
Posted: Sat Sep 27, 2008 06:08 AM
Silvio wrote:I must open a fdb archive and list the structure of each table
How I can make it ?

Can I have a small sample pls. ?


Silvio,

you see the blog from Andres.

CODIGO-BASE
William, Morales

Saludos



méxico.sureste
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Urgent: How Open a Firebird
Posted: Sat Sep 27, 2008 10:28 AM

I insert My admin and My password
Application
===========
Path and name: C:\work\prg\firebird\test.Exe (32 bits)
Size: 1,311,744 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 09/27/08, 12:29:11
Error description: Error ADOX.Catalog/16389 E_FAIL: _ACTIVECONNECTION
Args:
[ 1] = C Driver=Firebird/InterBase(r) driver;Uid=Administrator;Pwd=bpteramo;DbName=test.fdb

Stack Calls

Called from: win32ole.prg => TOLEAUTO:_ACTIVECONNECTION(0)
Called from: test.prg => MAIN(45)

System

CPU type: AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ -19448 Mhz
Hardware memory: 2048 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Compiler version: xHarbour build 0.99.71 Intl. (SimpLex)
Windows version: 5.1, Build 2600 Service Pack 2

Windows total applications running: 0

Best Regards, Saludos



Falconi Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Urgent: How Open a Firebird
Posted: Sat Sep 27, 2008 10:29 AM

Dear wmormar
I try also it
no run ok

Best Regards, Saludos



Falconi Silvio
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Urgent: How Open a Firebird
Posted: Sat Sep 27, 2008 10:34 AM

Maybe you haven't installed Firebird drivers correctly or haven't installed them at all.

EMG

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Urgent: How Open a Firebird
Posted: Sat Sep 27, 2008 10:47 AM
NO

I have installed Firebird correctly VERSION 2.1

and the service run correctly as you can see here




the test of wnormar (Tfirebird) run correctly
I must to insert sample.gdb in c:\bases
But My archive is Fdb extension no gdb


Dear Emg ,
with your sample How I must make the connection for the test.fdb ?
thanks
Best Regards, Saludos



Falconi Silvio
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Urgent: How Open a Firebird
Posted: Sat Sep 27, 2008 10:49 AM
Silvio wrote:NO

I have installed Firebird correctly VERSION 2.1


You have to install Firebird drivers for ODBC/ADO too.

EMG