Hello
Since installing XSharp 2.9a Public version the CopyDB() method seems to hang on
large .DBF files ( 75k + records ) and other .DBF’s are copied with few and duplicated
records. Reinstalled 2.8a and all seems OK ?
Neale
CopyDB() Method
CopyDB() Method
Hi Neal,
Can you please give us a sample showing the problem? I tried to reproduce it with the code below, but it seems to work fine (output dbf identical to the source dbf), so of course the test is missing something to make the problem manifest itself.
[tweet][/tweet]
Can you please give us a sample showing the problem? I tried to reproduce it with the code below, but it seems to work fine (output dbf identical to the source dbf), so of course the test is missing something to make the problem manifest itself.
Code: Select all
FUNCTION Start() AS INT
LOCAL cFileName AS STRING
cFileName := "c:testcopydb"
RddSetDefault("DBFCDX")
DbCreate(cFileName , {{"FLD1","C",20,0}})
FErase(cFileName + ".cdx")
DbUseArea(TRUE,,cFileName,,FALSE)
? "created"
FOR LOCAL n := 1 AS INT UPTO 500_000
DbAppend()
FieldPut(1, StrZero(n,10))
NEXT
DbCreateOrder("FLD1",cFileName,"FLD1")
DbCloseArea()
? "appended"
LOCAL db AS DbServer
db := DBServer{cFileName}
? db:CopyDB(cFileName + "_copy")
db:Close()
RETURN 0
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
CopyDB() Method
Hello Chris
Your example worked OK.
Will check again and send an example later, a snippet of the code I am using CopyDB ;
oArt3Server := DBServer{ SELF:cArt3Path + "Transact.DBF", FALSE }
oArt3Server:CopyDB( SELF:cArt4Path + "Transact.DBF" )
oArt3Server:Close()
oArt3Server := NULL_OBJECT
SELF:oDCProgressBar1:Advance(1)
Neale
Your example worked OK.
Will check again and send an example later, a snippet of the code I am using CopyDB ;
oArt3Server := DBServer{ SELF:cArt3Path + "Transact.DBF", FALSE }
oArt3Server:CopyDB( SELF:cArt4Path + "Transact.DBF" )
oArt3Server:Close()
oArt3Server := NULL_OBJECT
SELF:oDCProgressBar1:Advance(1)
Neale
CopyDB() Method
Hello Chris
Thanks for your help, I noticed in your example you deleted the associated .CDX file before calling CopyDB(), that solved the problem.
In 2.8a CopyDB() seemed to work without deleting the old .CDX.
All good and thanks again.
Neale
Thanks for your help, I noticed in your example you deleted the associated .CDX file before calling CopyDB(), that solved the problem.
In 2.8a CopyDB() seemed to work without deleting the old .CDX.
All good and thanks again.
Neale
CopyDB() Method
Hi Neal,
Ah, OK, glad to hear! I had not suspected that this could be the issue, I'm just always doing that before creating a new dbf/cdx set.
.
Ah, OK, glad to hear! I had not suspected that this could be the issue, I'm just always doing that before creating a new dbf/cdx set.
.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
CopyDB() Method
Neale,
In X# 2.8a we were deleting the production index (the cdx with the same name as the DBF) when creating a new dbf file.
We are no longer doing that because that was not compatible with Visual Objects and several other xbase implementations.
Robert
In X# 2.8a we were deleting the production index (the cdx with the same name as the DBF) when creating a new dbf file.
We are no longer doing that because that was not compatible with Visual Objects and several other xbase implementations.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu