# 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
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