Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Resultset doesn't let go of .dbf file on .close method
Message
De
18/01/2001 12:36:01
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Resultset doesn't let go of .dbf file on .close method
Divers
Thread ID:
00465220
Message ID:
00465220
Vues:
48
When I open a VFP .dbf file with an RDOresultset, and then use the .close method on the resultset, I cannot filecopy that .dbf. VB still has the file in use.

If I destroy the object reference to the RDOconnection, I can then copy the file.

Does anyone know what method I need to use in order to get VB to let go of that dbf ... without destroying the RDOConnection?

Thx, in advance, for any assistance in this regard.

Scott Barker
'*****************************************
'** Here's my test code...

Dim cn As New rdoConnection
Dim rs As rdoResultset
Dim sqlcmd As String

cn.Connect = "SourceType=DBF;SourceDB=c:\vbvfp;Driver={Microsoft Visual Foxpro Driver}"
cn.CursorDriver = rdUseOdbc
cn.EstablishConnection "rdDriverNoPrompt"
sqlcmd = "select * from tmp_cli"
Set rs = cn.OpenResultset(sqlcmd, rdOpenKeyset, rdConcurRowVer)

' *** The file gets edited here...

rs.Close


FileCopy ..... etc...
' A file copy at this point produces a permission denied error ... the .dbf is still in use.

'*****************************************
' If I try to copy the file ... I get an error here as VB still has the file open... I confirmed that the file is in use as I cannot open the dbf in VFP if I stop the code right here.
Répondre
Fil
Voir

Click here to load this message in the networking platform