ADO RecordSet to DBF

Re: ADO RecordSet to DBF

Postby avista » Mon Jul 14, 2014 2: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
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: ADO RecordSet to DBF

Postby nageswaragunupudi » Mon Jul 14, 2014 4: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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests