Colleagues,
Is there a way to convert programmatically, on run time, table files in dBase 2K with memo part (.DBT) into VFP format (DBF/CDX/FPT) from VFP without modifying that bloody DBT along the way?
I tried the following (in a FOR...NEXT cycle, but that's not the point):
USE IN (SELECT("TEMP_DBF")) && Just in case
** Switch dBASE compatibility on:
SET COMPATIBLE DB4
TRY
USE (lcSrcDBF) ALIAS TEMP_DBF NOUPDATE SHARED
COPY TO (lcDstDBF) WITH CDX
SELECT 0
USE (lcDstDBF) ALIAS DB_2_VFP EXCLUSIVE
REINDEX
USE IN DB_2_VFP
CATCH TO loErr
** etc.
SET COMPATIBLE OFF
Every time there's .DBT part in the dB2K table - I get the following error message:
Error #1659, The table has memo fields that cannot be converted while open read-only.
in the Such'n'Such method on line #Such-n-Such
Command/line:
USE (lcSrcDBF) ALIAS TEMP_DBF NOUPDATE SHARED
Apparently, SET COMPATIBLE DB4 does not affect VFP's handling of the .DBT files, and I have already the explanation gotten in my other thread related to the dB-to-VFP topic. So, this time around, I need not an explanation but a solution.
One of those I have already tested was
COPY FILE (FORCEEXT(lcSrcDBF, "*")) TO (FORCEEXT(lcDstDBF, "*"))
SET SAFETY OFF
USE (lcDstDBF) ALIAS TEMP_DBF EXCLUSIVE
SET SAFETY ON
and it wasn't exactly satisfactory: it asked whether to convert the memo to VFP and, if answered "Yes" asked whether to replace "soft" line endings with binary ones. Of course, I set CDPDIALOG OFF and these two questions disappeared, but I am still not sure if this is the best, if not the only, solution.
Any ideas are welcome!
Regards,
Ilya
Is there a way to convert programmatically, on run time, table files in dBase 2K with memo part (.DBT) into VFP format (DBF/CDX/FPT) from VFP without modifying that bloody DBT along the way?
I tried the following (in a FOR...NEXT cycle, but that's not the point):
USE IN (SELECT("TEMP_DBF")) && Just in case
** Switch dBASE compatibility on:
SET COMPATIBLE DB4
TRY
USE (lcSrcDBF) ALIAS TEMP_DBF NOUPDATE SHARED
COPY TO (lcDstDBF) WITH CDX
SELECT 0
USE (lcDstDBF) ALIAS DB_2_VFP EXCLUSIVE
REINDEX
USE IN DB_2_VFP
CATCH TO loErr
** etc.
SET COMPATIBLE OFF
Every time there's .DBT part in the dB2K table - I get the following error message:
Error #1659, The table has memo fields that cannot be converted while open read-only.
in the Such'n'Such method on line #Such-n-Such
Command/line:
USE (lcSrcDBF) ALIAS TEMP_DBF NOUPDATE SHARED
Apparently, SET COMPATIBLE DB4 does not affect VFP's handling of the .DBT files, and I have already the explanation gotten in my other thread related to the dB-to-VFP topic. So, this time around, I need not an explanation but a solution.
One of those I have already tested was
COPY FILE (FORCEEXT(lcSrcDBF, "*")) TO (FORCEEXT(lcDstDBF, "*"))
SET SAFETY OFF
USE (lcDstDBF) ALIAS TEMP_DBF EXCLUSIVE
SET SAFETY ON
and it wasn't exactly satisfactory: it asked whether to convert the memo to VFP and, if answered "Yes" asked whether to replace "soft" line endings with binary ones. Of course, I set CDPDIALOG OFF and these two questions disappeared, but I am still not sure if this is the best, if not the only, solution.
Any ideas are welcome!
Regards,
Ilya