Could not use
'C:\TestDB\Netfront\Netfront.accdb';file already in use
I have to enter a password to open my DB. once the DB is open, and I click on a form button that has some VBA that issues a "cnn.Open" command I get the runtime error. see code sample. the variable SupportDBPath2 is define as follows.
Expand|Select|Wrap|Line Numbers
- Public Const SupportDBPath2 = "C:\TestDB\NetFront\"
- Function ValidateShipmentEvents7()
- Dim cnn As New ADODB.Connection
- Dim cmd As New ADODB.Command
- Dim rst As New ADODB.Recordset
- cnn.Open "Provider=Microsoft.ace.oledb.12.0;Data Source=" & SupportDBPath2 & "NetFront.accdb;Persist Security Info=False"
- cmd.ActiveConnection = cnn
- rst.Open "SELECT * FROM [Distinct Query Date Final]", cnn, adOpenDynamic, adLockOptimistic, 1