http://www.ibphoenix.com/main.nfs?a=ibp ... bp_60_odbc
this my test prg
- Code: Select all Expand view
# 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