Saludos
Necesito migrar datos de tablas DBF/CDX creadas con FOXPRO
SELECT A
USE (cFile) VIA "DBFCDX"
Genera error de corrupcion
Tambien
SELECT A
USE (cFile) VIA "ADS"
Genera error 6080
Agradecido su colaboracion
Probare por la VIA ODBC
Local oCn,cQuery,cPass,cDB,cUser,oError,String ,oRs,b
cUser := " "
cDB := "PRUEBA.DBC"
cPass := " "
String := "Driver={Microsoft Visual FoxPro Driver};SourceType=DBC;SourceDB=" + cDB + ";Exclusive=No;NULL=NO;Collate=Machine;BACKGROUNDFETCH=NO;DELETED=NO"
//Otra manera tambien funciona
//String := "Provider=vfpoledb;Data Source=" + cDB + ";Collating Sequence=machine;"
/* funciona
oCn:Open("Provider=Advantage OLE DB Provider;User ID="+cUser +;
";Password="+cPass+";Data Source="+ cDB +";TableType=ADS_VFP;"+;
"Advantage Server Type=ADS_LOCAL_SERVER;")
*/
oCn := TOLEAUTO():New("ADODB.connection")
oCn:CursorLocation := adUseClient
oCn:Mode := adModeShareDenyNone
oCn:Open(String)
cQuery:= "select * from clase"
WITH OBJECT oRs := TOleAuto():New("adodb.recordset")
:CacheSize := 50
:CursorLocation := adUseClient
:CursorType := adOpenStatic
:LockType := adLockPessimistic
:Open( cQuery , String,1, 3 )
END
b:=1
oRs:MoveFirst()
DO WHILE .NOT. oRs:EOF()
?oRs:Fields("clase"):value+" "+oRs:Fields("descripcio"):value
b++
oRs:MoveNext()
ENDDO
oRs:Close();oCn:Close()
SET DBFLOCKSCHEME TO
// Constant Value Description
DB_DBFLOCK_DEFAULT 0 Default locking scheme
DB_DBFLOCK_CLIP 1 Clipper 5.2 locking scheme
DB_DBFLOCK_CL53 2 Clipper 5.3 locking scheme
DB_DBFLOCK_VFP 3 Visual FoxPro locking scheme
DB_DBFLOCK_CL53EXT 4 Emulated shared locking
DB_DBFLOCK_XHB64 5 Locking scheme for files > 4GB
#include "dbinfo.ch"
procedure main()
SET DBFLOCKSCHEME TO DB_DBFLOCK_VFP
USE (tabla_fox_pro) NEW
return
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 31 guests