Hi,
wouldn`t it be good, if a Database (the connection) would be closed automatically, when you`re killing a program.
Access and PB4.10.
thanx and greetings
Marco
Closedatabase when killing program....
Closedatabase when killing program....
PureBasic for Windows
I have many databases here at work and this does not happen here.
PB calls CloseDatabase() while exit automatically and I dont need to remove the ODBC connection from the database for editing it.
But you can try it yourself using Rings-connection on thy fly-procedures:
PB calls CloseDatabase() while exit automatically and I dont need to remove the ODBC connection from the database for editing it.
But you can try it yourself using Rings-connection on thy fly-procedures:
Code: Select all
#ODBC_ADD_DSN = 1 ; Add Data source
#ODBC_ADD_SYS_DSN = 4 ; Add SYSTEM Data source
#ODBC_CONFIG_DSN = 2 ; Configure (edit) Data source
#ODBC_REMOVE_DSN = 3 ; Remove Data source
#ODBC_REMOVE_SYS_DSN = 6 ; Remove SYSTEM Data source
Procedure DeleteConnection(Driver.s,DSN.s)
Result=OpenLibrary(1,"ODBCCP32.DLL")
If Result
lpszDriver.s=Driver
strAttributes.s = "DSN="+DSN
Result = CallFunction(1, "SQLConfigDataSource", 0,#ODBC_REMOVE_SYS_DSN,lpszDriver.s,strAttributes )
CloseLibrary(1)
If Result
ProcedureReturn 1;MessageRequester("Info","DSN Delete",0)
EndIf
EndIf
EndProcedure
DeleteConnection("Microsoft Access Driver (*.mdb)","YourDatabaseName")
Tranquil
I tried here at work. Even if I kill the process within the IDE the connection gets closed. My thought is, that the system (Windows 2000 here) frees and releases the connection.
I dont think that PB frees alls resources on killing the process. As it says it: it kills the process, so there will be no clean up routine-calls any more.
Which OS do you use?
Edit: You may take a look on the .ldb files within the folder of you access databases. Sometimes its needed to delete them to gain admin access again on the database. (here at least once a month)
I dont think that PB frees alls resources on killing the process. As it says it: it kills the process, so there will be no clean up routine-calls any more.
Which OS do you use?
Edit: You may take a look on the .ldb files within the folder of you access databases. Sometimes its needed to delete them to gain admin access again on the database. (here at least once a month)
Tranquil
Yes, the *.ldb is not deleted, that`s why I recognized it.
I´ll always put a Isdatabase at the end of the program, but that just (of course) works with normal closing.
But while coding, there are often bugs (I see with the debugger) and so I sometimes kill the program.
> Tranquil wrote: ..once a month -> I guess this isn`t normal.
XP PB4.10
I´ll always put a Isdatabase at the end of the program, but that just (of course) works with normal closing.
But while coding, there are often bugs (I see with the debugger) and so I sometimes kill the program.
> Tranquil wrote: ..once a month -> I guess this isn`t normal.
XP PB4.10
PureBasic for Windows
This is not normal, you are right. But this happens fast if user kill your application using the taskmanager or the system kills your process on windows shutdown course you application needs to long to exit....Marco2007 wrote: > Tranquil wrote: ..once a month -> I guess this isn`t normal.
XP PB4.10
Tranquil