FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO RecordSet to DBF
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: ADO RecordSet to DBF
Posted: Mon Jul 14, 2014 02:09 PM

Thanks,

Possible help for now how to detect filedname, fieldtype, fieldlen, fielddec from ado recordset ?
If no it is ok ...i will go back to ODBC for now :(

BEST best regards,
Thanks

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ADO RecordSet to DBF
Posted: Mon Jul 14, 2014 04:36 PM

oField := oRs:Fields( n ) // n is zero based
or
oField := oRs:Fields( "<fieldname>" )

Then
oField:Name --> field name
oField:Type --> Ado Type of the field as numeric
You can find all ado field types here

http://www.w3schools.com/asp/ado_datatypes.asp

For character fields:
oField:DefinedSize --> Field length
For Numeric fields of type Decimal and Number:
oField:Precision --> Length
oField:NumericScale --> number of decimals
For numeric fields like double, float, etc.
we need to set Len and Dec on our own.

If you go through METHOD SetColFromADO() in the xbrowse.prg you can find how to use all the above how to derive DBF style types, etc from the above information.

This should be enough to answer all your questions.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion