Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Resultset doesn't let go of .dbf file on .close method
Message
From
18/01/2001 12:36:01
Scott Barker
Barker Systems Consulting Ltd.
North Vancouver, British Columbia, Canada
 
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Resultset doesn't let go of .dbf file on .close method
Miscellaneous
Thread ID:
00465220
Message ID:
00465220
Views:
49
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.
Reply
Map
View

Click here to load this message in the networking platform