How to close SQLite Connection?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: How to close SQLite Connection?

Post by mustafa »

Gracias Luis por tu respuesta, mi pregunta es como se puede hacer aparte
de lo que es peligroso como en su día Rathinagiri puso que lo consiguió
Borrar el Fichero con:
*-----------------------------------------------------------------------------*
dbo: = hdbcSQLTConnection ( "sample.db3" .T.)
dbo: Close ()
dbo: = Nil
hb_gcall (.T.)
zx: = FERASE ( "sample.db3")
MsgInfo (str (zx))
*------------------------------------------------------------------------------*
Si no se habre la Base de datos, Borra perfecto File('sample.db3' y MsgInfo (str (zx)) indica "0" Ok

Code: Select all

#include "hmg.ch"
 public dex := nil

IF FILE('sample.db3') 
   Copy File('sample.db3')    To 'sample_1.db3' 
ELSE
   Copy File('sample_1.db3')  To 'sample.db3' 
ENDIF

 dex := hdbcSQLTConnection( "sample.db3", .T. )
 dex:Close() 
 dex :=  nil

 hb_gcall( .T. ) 
 zx := ferase( 'sample.db3' )
 msgInfo( str( zx ) )

return


El Problema está cuando se consulta la Base datos en el Sample anterior y luego intentas Borrarla,
No te deja porque está Open.

saludos
Mustafa
*--------------------------------------------------- Google ---------------------------------------------
Luis Thanks for your answer, my question is how you can do apart
what is dangerous as once it got put Rathinagiri
Delete the file with:
* ------------------------------------------------- ---------------------------- *
dbo: = hdbcSQLTConnection ("sample.db3" .T.)
dbo: Close ()
dbo: = Nil
hb_gcall (.T.)
zx: = FERASE ("sample.db3")
MsgInfo (str (zx))
* ------------------------------------------------------------------------------- *
If not open the database, Eraser perfect, File('sample.db3' and MsgInfo (str (zx)) indicates "0" Ok

Code: Select all

#include "hmg.ch"
 public dex := nil

IF FILE('sample.db3') 
   Copy File('sample.db3')    To 'sample_1.db3' 
ELSE
   Copy File('sample_1.db3')  To 'sample.db3' 
ENDIF

 dex := hdbcSQLTConnection( "sample.db3", .T. )
 dex:Close() 
 dex :=  nil

 hb_gcall( .T. ) 
 zx := ferase( 'sample.db3' )
 msgInfo( str( zx ) )

return


The problem is when the data base is consulted in the previous Sample and then try to delete it,
Will not let you because it is Open.
regards

Mustafa
Post Reply