Page 1 of 1

Strange behavior of ACTION clause

Posted: Mon Oct 08, 2007 10:08 am
by Enrico Maria Giordano
Try the following sample (you will need of an MDB file). Now remove the comment of the ACTION clause and you will notice that the LDB file is not deleted anymore. Why?

Code: Select all

#include "Fivewin.ch"


#define adOpenForwardOnly 0
#define adOpenKeyset      1
#define adOpenDynamic     2
#define adOpenStatic      3

#define adLockReadOnly        1
#define adLockPessimistic     2
#define adLockOptimistic      3
#define adLockBatchOptimistic 4

#define adUseNone   1
#define adUseServer 2
#define adUseClient 3


FUNCTION MAIN()

    LOCAL oRs := CREATEOBJECT( "ADODB.Recordset" )

    oRs:Open( "SELECT * FROM Clienti", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clienti.mdb", adOpenKeyset, adLockOptimistic )

    TEST( oRs )

    oRs:Close()

    oRs = NIL

    RETURN NIL


STATIC FUNCTION TEST( oRs )

    LOCAL oDlg

    DEFINE DIALOG oDlg

    @ 1, 1 BUTTON "";
//           ACTION oRs

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL
EMG

Posted: Mon Oct 08, 2007 12:03 pm
by Antonio Linares
Enrico,

> the LDB file is not deleted

Whats the LDB file ?

Posted: Mon Oct 08, 2007 3:40 pm
by Enrico Maria Giordano
It is a file that Jet engine uses to handle multiuser locking. It should be automatically deleted when the database is closed.

EMG