Urgent: How Open a Firebird

User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Now I instyalled also firebird_odbc from

http://www.ibphoenix.com/main.nfs?a=ibp ... bp_60_odbc


this my test prg

Code: Select all


 



# include"fivewin.ch"
//Connection to FDB archive

 // LockType
#define adLockUnspecified   -1
#define adLockReadOnly       1
#define adLockPessimistic    2
#define adLockOptimistic     3
#define adLockBatchOptimistic 4

// CursorType
#define adOpenUnspecified     1
#define adOpenForwardOnly     0
#define adOpenKeyset          1
#define adOpenDynamic         2
#define adOpenStatic          3



// Cursor Location
#define adUseClient           3
#define adUseServer           2

// State constants

#define   adStateClosed       0    //The object is closed
#define adStateOpen           1    //The object is open





FUNCTION MAIN()

    LOCAL oCat

    LOCAL i, j

    oCat = CREATEOBJECT( "ADOX.Catalog" )

    oCat:ActiveConnection = "Driver=Firebird/InterBase(r) driver;Uid=admin;Pwd=bpteramo;DbName=test.fdb"

    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














Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

if make a connection to sample.gdb run perfectly
if I made a connection to test.fdb it not run

Code: Select all


# include"fivewin.ch"
//Connection to FDB archive

 // LockType
#define adLockUnspecified   -1
#define adLockReadOnly       1
#define adLockPessimistic    2
#define adLockOptimistic     3
#define adLockBatchOptimistic 4

// CursorType
#define adOpenUnspecified     1
#define adOpenForwardOnly     0
#define adOpenKeyset          1
#define adOpenDynamic         2
#define adOpenStatic          3



// Cursor Location
#define adUseClient           3
#define adUseServer           2

// State constants

#define   adStateClosed       0    //The object is closed
#define adStateOpen           1    //The object is open

 #define PAD_LEFT            0
#define PAD_RIGHT           1
#define PAD_CENTER          2



FUNCTION MAIN()

    LOCAL oCat

    LOCAL i, j
     local oPrn , ROW:=1.1
    oCat = CREATEOBJECT( "ADOX.Catalog" )

    oCat:ActiveConnection = "Driver=Firebird/InterBase(r) driver;Uid=sysdba;Pwd=bpteramo;DbName=c:\bases\test.fdb"

    PRINT oPrn NAME "Test" PREVIEW
      DEFINE FONT oFont NAME "Arial" SIZE 0, -8 BOLD OF oPrn
      DEFINE PEN oPen WIDTH  2                        OF oPrn
      PAGE

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

       oPrn:cmSay( ROW,  1.0, oCat:Tables( i ):Name, oFont,,CLR_BLACK,,PAD_LEFT  )

       FOR j = 0 TO oCat:Tables( i ):Columns:Count() - 1
           oPrn:cmSay( ROW+0.1,  1.0,( 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 )) , oFont,,CLR_BLACK,,PAD_LEFT  )
               ROW:=ROW+0.1
        NEXT

     ROW:=ROW+0.2
     NEXT

          ENDPAGE
   ENDPRINT
    RETURN NIL




I cannot send my file because it size is 198 mb ..how I can make to open it ?
Best Regards, Saludos

Falconi Silvio
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Carefully check path and file name. If it still doesn't work then I don't know, sorry.

EMG
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

It is very strange !!!

it make error not open the file fdb

the file test.fdb is a file of another application Not mine.

I wanted only know the structure because i want use the fdb for another application .

Now i try with a recovery file fdb ,(i found it on google) , i insert as uid Sysdba and as password bpteramo and this procedure open my file and check if there is someone of wrong .
but this application not show me the structure of this file.

This to say to you that the password is right.

How i can resolve it?
Best Regards, Saludos

Falconi Silvio
User avatar
wmormar
Posts: 1050
Joined: Fri Oct 07, 2005 10:41 pm
Location: México
Contact:

Post by wmormar »

Silvio wrote:Dear wmormar
I try also it
no run ok
que version de firebird usas?
William, Morales
Saludos

méxico.sureste
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

firebird 2.1 but the firebird odbc not understand wich version
Best Regards, Saludos

Falconi Silvio
User avatar
wmormar
Posts: 1050
Joined: Fri Oct 07, 2005 10:41 pm
Location: México
Contact:

Post by wmormar »

Silvio wrote:firebird 2.1 but the firebird odbc not understand wich version
Silvio,

la lib que se encuentra en el blog de Andrés, no necesita ODBC.

así que facilmente se podría empezar a utilizar.

mis correos y messenger:

wmormar@yahoo.com.mx
wmormar@hotmail.com
William, Morales
Saludos

méxico.sureste
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

I not found a solution with thid firebird
Also this thing is not possible with fwh
I hope on future ...
Best Regards, Saludos

Falconi Silvio
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Error

Post by lailton.webmaster »

Firebird error

Code: Select all

# include"fivewin.ch" 
//Connection to FDB archive 

 // LockType 
#define adLockUnspecified   -1 
#define adLockReadOnly       1 
#define adLockPessimistic    2 
#define adLockOptimistic     3 
#define adLockBatchOptimistic 4 

// CursorType 
#define adOpenUnspecified     1 
#define adOpenForwardOnly     0 
#define adOpenKeyset          1 
#define adOpenDynamic         2 
#define adOpenStatic          3 



// Cursor Location 
#define adUseClient           3 
#define adUseServer           2 

// State constants 

#define   adStateClosed       0    //The object is closed 
#define adStateOpen           1    //The object is open 

 #define PAD_LEFT            0 
#define PAD_RIGHT           1 
#define PAD_CENTER          2 



FUNCTION MAIN() 

    LOCAL oCat 

    LOCAL i, j 
     local oPrn , ROW:=1.1 
    oCat = CREATEOBJECT( "ADOX.Catalog" ) 

    oCat:ActiveConnection = "Driver=Firebird/InterBase(r) driver;Uid=SYSDBA;Pwd=masterkey;DbName=c:\Lailton\try\dados.FDB;" 

    PRINT oPrn NAME "Test" PREVIEW 
      DEFINE FONT oFont NAME "Arial" SIZE 0, -8 BOLD OF oPrn 
      DEFINE PEN oPen WIDTH  2                        OF oPrn 
      PAGE 

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

       oPrn:cmSay( ROW,  1.0, oCat:Tables( i ):Name, oFont,,CLR_BLACK,,PAD_LEFT  ) 

       FOR j = 0 TO oCat:Tables( i ):Columns:Count() - 1 
           oPrn:cmSay( ROW+0.1,  1.0,( 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 )) , oFont,,CLR_BLACK,,PAD_LEFT  ) 
               ROW:=ROW+0.1 
        NEXT 

     ROW:=ROW+0.2 
     NEXT 

          ENDPAGE 
   ENDPRINT 
    RETURN NIL 
 
error

Code: Select all

Código: 

Application 
=========== 
   Path and name: C:\lailton\try\menu.exe (32 bits) 
   Size: 1,380,352 bytes 
   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 10/31/08, 08:52:40 
   Error description: Error ADOX.Catalog/6  DISP_E_UNKNOWNNAME: _ACTIVECONNECTION 
   Args: 
     [   1] = C   Driver=Firebird/InterBase(r) driver;Uid=SYSDBA;Pwd=masterkey;DbName=c:\Lailton\try\dados.FDB; 

Stack Calls 
=========== 
   Called from: win32ole.prg => TOLEAUTO:_ACTIVECONNECTION(0) 
   Called from: MENU.PRG => MAIN(43) 

System 
====== 
   CPU type:                 Intel(R) Celeron(R) CPU 2.66GHz 2666 Mhz 
   Hardware memory: 992 megs 

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

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

   Windows total applications running: 0 

Variables in use 
================ 
   Procedure     Type   Value 
   ========================== 
   TOLEAUTO:_ACTIVECONNECTION 
     Param   1:    C    "Driver=Firebird/InterBase(r) driver;Uid=SYSDBA;Pwd=masterkey;DbName=c:\Lailton\try\dados.FDB;" 
     Local   1:    U    
     Local   2:    N    0 
   MAIN 
     Local   1:    O    Class: TOLEAUTO 
     Local   2:    U    
     Local   3:    U    
     Local   4:    U    
     Local   5:    N    1.1 
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

??

Post by lailton.webmaster »

???

Someone know what do ??????

i need make export dbf to firebird URGENTE

i have dbf 5Mb and need export to FDB

someone can help me ?

thanks
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

I have 128 MB of a firebird fbd
Best Regards, Saludos

Falconi Silvio
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Post by hua »

For ADO+Firebird+[x]Harbour, this might help as a starting point.

The following might be useful also, http://www.ibprovider.com/eng/documenta ... e_database
Post Reply