I create a database like this:
Sub Main()
Dim wrkDefault As Workspace
Dim dbE As DBEngine
Dim dbs As Database
'Get default Workspace.
dbE = New DBEngine
wrkDefault = dbE.Workspaces(0)
'Set the database filename
Dim DBFilename As String
DBFilename = "c:\mydb.mdb"
'Make sure there isn't already a file with the same name of
'the new database file.
If Dir(DBFilename) <> "" Then
MsgBox("File already exists!")
Exit Sub
End If
'Create a new encrypted database with the specified
'collating order.
'lock database with the password 'hello'
dbs = wrkDefault.CreateDatabase(DBFilename, _
LanguageConstants.dbLangGeneral & ";pwd=hello;", DatabaseTypeEnum.dbEncrypt)
dbs.Close()
End Sub
How do I open this database again in VB.NET using DAO?