Fivewin and access

Fivewin and access

Postby Jack » Thu Aug 21, 2008 7:40 am

I have to write data (from a dbf) in an access table .
How to know the field type, field size of all the fields of the access table .

It seems that there is an error when a try to write a field longer then
the defined lenght in the access table .
Thanks for your help .
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Re: Fivewin and access

Postby Enrico Maria Giordano » Thu Aug 21, 2008 8:43 am

This is a sample:

Code: Select all  Expand view  RUN
FUNCTION MAIN()

    LOCAL oCat

    LOCAL i, j

    oCat = CREATEOBJECT( "ADOX.Catalog" )

    oCat:ActiveConnection = "your connection string here"

    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
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests