Hi there
I'm very new to VB.Net and only performed some simple coding in Access prior to this so hopefully this is a basic question.
If I am declaring objects or variables such as a connection string or Access Application, how do I write the code so that I only need to declare them once (say on page startup) and not everytime I need to connect to the Access Database. Example is as follows:
Protected Sub btnMacro_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnMacro.Click
Dim objaccess As Object = CreateObject("access.application")
Dim strDB As String = "C:\LA Applications\DRep\V3008\DEBT_V3008.mdb"
Thanks in advance!
David
I'm very new to VB.Net and only performed some simple coding in Access prior to this so hopefully this is a basic question.
If I am declaring objects or variables such as a connection string or Access Application, how do I write the code so that I only need to declare them once (say on page startup) and not everytime I need to connect to the Access Database. Example is as follows:
Protected Sub btnMacro_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnMacro.Click
Dim objaccess As Object = CreateObject("access.application")
Dim strDB As String = "C:\LA Applications\DRep\V3008\DEBT_V3008.mdb"
Thanks in advance!
David