Page 1 of 2
Urgent: How Open a Firebird
Posted: Fri Sep 26, 2008 8:37 am
by Silvio
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. ?
Posted: Fri Sep 26, 2008 9:29 am
by Antonio Linares
Silvio,
You may use ADO to open and manage it.
Posted: Fri Sep 26, 2008 9:49 am
by Silvio
on the same mode I open MDB access file ?
thanks I try now
to print each structure table
wich is the command ?
Posted: Fri Sep 26, 2008 10:57 am
by Enrico Maria Giordano
Silvio wrote:to print each structure table
wich is the command ?
Code: Select all
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
Posted: Fri Sep 26, 2008 3:14 pm
by Silvio
thanks emg,
Posted: Fri Sep 26, 2008 3:41 pm
by Silvio
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)
Posted: Fri Sep 26, 2008 3:50 pm
by James Bott
There is a sample Firebird connection string on this page:
http://www.connectionstrings.com/?carrier=firebird
Regards,
James
Posted: Sat Sep 27, 2008 12:32 am
by Silvio
i try with Driver=Firebird/InterBase(r) driver;Uid=SYSDBA;Pwd=masterkey;DbName=TEST.FDB;
but it make the same error
Posted: Sat Sep 27, 2008 5:42 am
by James Bott
You have to use your own user ID and password.
James
Re: Urgent: How Open a Firebird
Posted: Sat Sep 27, 2008 6:08 am
by wmormar
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
Posted: Sat Sep 27, 2008 10:28 am
by Silvio
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
Posted: Sat Sep 27, 2008 10:29 am
by Silvio
Dear wmormar
I try also it
no run ok
Posted: Sat Sep 27, 2008 10:34 am
by Enrico Maria Giordano
Maybe you haven't installed Firebird drivers correctly or haven't installed them at all.
EMG
Posted: Sat Sep 27, 2008 10:47 am
by Silvio
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
Posted: Sat Sep 27, 2008 10:49 am
by Enrico Maria Giordano
Silvio wrote:NO
I have installed Firebird correctly VERSION 2.1
You have to install Firebird
drivers for ODBC/ADO too.
EMG