ADO RecordSet to DBF
ADO RecordSet to DBF
Hi all,
I need help how to create DBF file and insert data from ADO Recordset
Best regards,
I need help how to create DBF file and insert data from ADO Recordset
Best regards,
- Rick Lipkin
- Posts: 2668
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: ADO RecordSet to DBF
Avista
Here is the psudo code ..
1) Create your .dbf
2) Open your recordset ...
Rick Lipkin
Here is the psudo code ..
1) Create your .dbf
2) Open your recordset ...
Code: Select all | Expand
oRs:MoveFirst()
Do While .not. oRs:Eof
Select 1
Append Blank
a->Field1 := oRs:Fields("Field1"):Value
a->Field2 := oRs:Fields("Field2"):Value
oRs:MoveNext()
Enddo
CLose Databases
oRs:Close()
Rick Lipkin
Re: ADO RecordSet to DBF
Rick,
Thanks for reply,
That is my problem ... i cant create .DBF becouse i dont know fields ...
becouse RecordSet is openet berore that and contains data from executed SQL
I want to export data from opened recordset to .dbf file
So i mean to read first the fields from recordset, (filedname, fieldtype, fieldlen, fielddec )
and after that to create .dbf and insert data in .dbf file
Any solution please ?
Best regards,
Thanks for reply,
1) Create your .dbf
That is my problem ... i cant create .DBF becouse i dont know fields ...
becouse RecordSet is openet berore that and contains data from executed SQL
I want to export data from opened recordset to .dbf file
So i mean to read first the fields from recordset, (filedname, fieldtype, fieldlen, fielddec )
and after that to create .dbf and insert data in .dbf file
Any solution please ?
Best regards,
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: ADO RecordSet to DBF
FWH already provides a ready made function for this.
FW_AdoExportToDBF( oRs, cDbf, lEditStruct )
FW_AdoExportToDBF( oRs, cDbf, lEditStruct )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: ADO RecordSet to DBF
Rao Thanks for reply
I have seen on this forum that this functuins are includer in version 13.08
I still use 13.04 and not ready in this moment to change version and test apps
viewtopic.php?f=3&t=28708&start=30
BTW I use Informix and i am not ready now to test it.
Can i find the source of functions:
function FWAdoDelRecord( oRs ) --> lSuccess
function FWAdoFieldType( oRs, n ) --> cType (xbase type)
function FWAdoFieldDec( oRs, n ) --> nDecs (xbase)
function FWAdoFieldSize( oRs, n ) --> nSize (xbase)
function FWAdoLoadRecord( oRs ) --> aRecord
function FWAdoSaveRecord( oRS, aRecord, nRecNo ) --> nil
function FWAdoStruct( oRs ) --> aStruct
function FWAdoFieldStruct( oRs, n/cname/ofield) or (oField)
-> field strut info { cName, cDbtype, nDblen, nDbdec, nAdotype, lReadwrite }
function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) --> lSuccess
Best regards,
FWH already provides a ready made function for this.
FW_AdoExportToDBF( oRs, cDbf, lEditStruct )
I have seen on this forum that this functuins are includer in version 13.08
I still use 13.04 and not ready in this moment to change version and test apps
viewtopic.php?f=3&t=28708&start=30
Re: DBF to SQL script tool
New postby nageswaragunupudi » Fri Jul 11, 2014 2:37 am
Mr Hakan ONEMLI
FWH Ado functions work for Access, MS Sql, MySql, Oracle and SQLite3.
Regards
G. N. Rao.
Hyderabad, India
nageswaragunupudi
BTW I use Informix and i am not ready now to test it.
Can i find the source of functions:
function FWAdoDelRecord( oRs ) --> lSuccess
function FWAdoFieldType( oRs, n ) --> cType (xbase type)
function FWAdoFieldDec( oRs, n ) --> nDecs (xbase)
function FWAdoFieldSize( oRs, n ) --> nSize (xbase)
function FWAdoLoadRecord( oRs ) --> aRecord
function FWAdoSaveRecord( oRS, aRecord, nRecNo ) --> nil
function FWAdoStruct( oRs ) --> aStruct
function FWAdoFieldStruct( oRs, n/cname/ofield) or (oField)
-> field strut info { cName, cDbtype, nDblen, nDbdec, nAdotype, lReadwrite }
function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) --> lSuccess
Best regards,
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: ADO RecordSet to DBF
Understand.
We might consider expanding the coverage to other SQL DBMSs depending on the users' requirements.
We might consider expanding the coverage to other SQL DBMSs depending on the users' requirements.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: ADO RecordSet to DBF
Thanks Rao
But please any other solution or
Can i find the source of functions:
function FWAdoDelRecord( oRs ) --> lSuccess
function FWAdoFieldType( oRs, n ) --> cType (xbase type)
function FWAdoFieldDec( oRs, n ) --> nDecs (xbase)
function FWAdoFieldSize( oRs, n ) --> nSize (xbase)
function FWAdoLoadRecord( oRs ) --> aRecord
function FWAdoSaveRecord( oRS, aRecord, nRecNo ) --> nil
function FWAdoStruct( oRs ) --> aStruct
function FWAdoFieldStruct( oRs, n/cname/ofield) or (oField)
-> field strut info { cName, cDbtype, nDblen, nDbdec, nAdotype, lReadwrite }
function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) --> lSuccess
or sample .PRG for my case
how to detect type, size, dec ...for fields
Best regards,
Understand.
We might consider expanding the coverage to other SQL DBMSs depending on the users' requirements.
But please any other solution or
Can i find the source of functions:
function FWAdoDelRecord( oRs ) --> lSuccess
function FWAdoFieldType( oRs, n ) --> cType (xbase type)
function FWAdoFieldDec( oRs, n ) --> nDecs (xbase)
function FWAdoFieldSize( oRs, n ) --> nSize (xbase)
function FWAdoLoadRecord( oRs ) --> aRecord
function FWAdoSaveRecord( oRS, aRecord, nRecNo ) --> nil
function FWAdoStruct( oRs ) --> aStruct
function FWAdoFieldStruct( oRs, n/cname/ofield) or (oField)
-> field strut info { cName, cDbtype, nDblen, nDbdec, nAdotype, lReadwrite }
function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) --> lSuccess
or sample .PRG for my case
how to detect type, size, dec ...for fields
Best regards,
Re: ADO RecordSet to DBF
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Re: ADO RecordSet to DBF
Navarro thanks for reply
I urgent need the source of function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] )
or same similar source sample
Best regards,
I urgent need the source of function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] )
or same similar source sample
Best regards,
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: ADO RecordSet to DBF
avista wrote:Rao Thanks for replyFWH already provides a ready made function for this.
FW_AdoExportToDBF( oRs, cDbf, lEditStruct )
I have seen on this forum that this functuins are includer in version 13.08
I still use 13.04 and not ready in this moment to change version and test apps
viewtopic.php?f=3&t=28708&start=30Re: DBF to SQL script tool
New postby nageswaragunupudi » Fri Jul 11, 2014 2:37 am
Mr Hakan ONEMLI
FWH Ado functions work for Access, MS Sql, MySql, Oracle and SQLite3.
Regards
G. N. Rao.
Hyderabad, India
nageswaragunupudi
BTW I use Informix and i am not ready now to test it.
Can i find the source of functions:
function FWAdoDelRecord( oRs ) --> lSuccess
function FWAdoFieldType( oRs, n ) --> cType (xbase type)
function FWAdoFieldDec( oRs, n ) --> nDecs (xbase)
function FWAdoFieldSize( oRs, n ) --> nSize (xbase)
function FWAdoLoadRecord( oRs ) --> aRecord
function FWAdoSaveRecord( oRS, aRecord, nRecNo ) --> nil
function FWAdoStruct( oRs ) --> aStruct
function FWAdoFieldStruct( oRs, n/cname/ofield) or (oField)
-> field strut info { cName, cDbtype, nDblen, nDbdec, nAdotype, lReadwrite }
function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) --> lSuccess
Best regards,
They are all functions in the later versions of FWH and the proper way to get the source code of these functions is by upgrading FWH.
FWH being a priced product, we can not share the source code of FWH libraries freely over the forum or otherwise.
But the above functions are not really difficult and one can write by himself.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Re: ADO RecordSet to DBF
Avista,
We can help you with FW_AdoExportToDBF() (I will check it with Rao and I may send you some code by email) but as Rao has clearly explained to you, if you want to use the result of our hard work, you should upgrade your FWH version, thanks for understanding it.
We can help you with FW_AdoExportToDBF() (I will check it with Rao and I may send you some code by email) but as Rao has clearly explained to you, if you want to use the result of our hard work, you should upgrade your FWH version, thanks for understanding it.
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Re: ADO RecordSet to DBF
You can keep using FWH 13.04, upgrade to FWH 14.06, copy the required functions that you need and continue using 13.04.
I am sure that you also ask your customers to get paid by your work![Smile :-)](./images/smilies/icon_smile.gif)
I am sure that you also ask your customers to get paid by your work
![Smile :-)](./images/smilies/icon_smile.gif)
Re: ADO RecordSet to DBF
Thanks to all
In start i only asked how to detect from ado recordset
I use informix
So probably FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) will not help for informix database
If possible i need some help about that how to write function which detect filedname, fieldtype, fieldlen, fielddec from ado recordset and after that i will create .dbf aind insert data from ado recordset.
Antonio,
If you can please send me some start sample source code
sunrised@t-home.mk
Tnanks,
Regards,
In start i only asked how to detect from ado recordset
filedname, fieldtype, fieldlen, fielddec
I use informix
Re: DBF to SQL script tool
New postby nageswaragunupudi » Fri Jul 11, 2014 2:37 am
Mr Hakan ONEMLI
FWH Ado functions work for Access, MS Sql, MySql, Oracle and SQLite3.
Regards
G. N. Rao.
Hyderabad, India
nageswaragunupudi
Understand.
We might consider expanding the coverage to other SQL DBMSs depending on the users' requirements.
Regards
G. N. Rao.
Hyderabad, India
So probably FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) will not help for informix database
But the above functions are not really difficult and one can write by himself.
Regards
G. N. Rao.
Hyderabad, India
If possible i need some help about that how to write function which detect filedname, fieldtype, fieldlen, fielddec from ado recordset and after that i will create .dbf aind insert data from ado recordset.
Antonio,
If you can please send me some start sample source code
sunrised@t-home.mk
Tnanks,
Regards,
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: ADO RecordSet to DBF
FWH Ado functions work for Access, MS Sql, MySql, Oracle and SQLite3.
That means "all" functions in adofuncs.prg work for these DBMSs. Just a clarification. Many functions work for *all* DBMSs.
For example, for creation of Table on DBMS, we need to know specific datatypes of the DBMS. Also if keywords are used as some field names we need to know how to quote such field names which conflict with keywords. This is different for different DBMSs.
Except create table and sql generation functions, all pure ADO functions work for all DBMSs.
In particular,
Fw_OpenAdoConnection( cConnString )
FW_OpenRecordSet(...)
And all function listed above in this post including FW_AdoExportToDBF(..) work for all DBMSs.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India