I use vbRichClient5 for Sqlite.
Let's say we have multiple memory databases.
For example three memory databases in one Sub, another memory database in another Sub and a global memory database declared in a bas module and available to the whole vbp project:
The connections can be set to Nothing at the end of the Subs (or for the global connection, in the MDIForm_Unload)
Or, if we don't explicitly set them to Nothing, they will be cleared anyway when they go out of scope.
So, that is not a problem.
Also, they do not interfere with each other as they have been declared as separate connection variables.
But, those New_c variables confuse me a little bit.
They are only one, so won't that cause any problem?
For example causing interference between the multiple memory databases?
Also, how about setting them to Nothing?
Should I set them to Nothing?
Forgive me for my ignorance, but, this matter is a bit confusing to me.
Any help would be appreciated.
Thanks.
Let's say we have multiple memory databases.
For example three memory databases in one Sub, another memory database in another Sub and a global memory database declared in a bas module and available to the whole vbp project:
Code:
Private Sub Proc_One
Dim Cnn1 As cConnection
Dim Cnn2 As cConnection
Dim Cnn3 As cConnection
Set Cnn1 = New_c.Connection(, DBCreateInMemory)
......
Set Cnn2 = New_c.Connection(, DBCreateInMemory)
......
Set Cnn3 = New_c.Connection(, DBCreateInMemory)
......
......
End Sub
Code:
Private Sub Proc_Two
Dim Cnn4 As cConnection
Set Cnn4 = New_c.Connection(, DBCreateInMemory)
......
......
End Sub
Code:
Public CnnGlobal As cConnection
Public Sub Main()
Set CnnGlobal = New_c.Connection(, DBCreateInMemory)
......
......
End Sub
Or, if we don't explicitly set them to Nothing, they will be cleared anyway when they go out of scope.
So, that is not a problem.
Also, they do not interfere with each other as they have been declared as separate connection variables.
But, those New_c variables confuse me a little bit.
They are only one, so won't that cause any problem?
For example causing interference between the multiple memory databases?
Also, how about setting them to Nothing?
Should I set them to Nothing?
Forgive me for my ignorance, but, this matter is a bit confusing to me.
Any help would be appreciated.
Thanks.