PRB: Can't Connect Data Control to a Password Protected MDBID: Q160169
|
If you attempt to use the Data control to connect to a password-protected
Access database at design time, you will receive the error message:
"Not a valid password"
In the Properties window, set the following properties for the Data
control:
Property Value of Property
---------------- ---------------------
DatabaseName ATEST.MDB
Connect ;pwd=aaa
RecordSource Table1
This behavior is by design.
Private Sub Form_Load()
Dim DB As Database
Dim tblDef As TableDef, fld As Field
Set DB = DBEngine.Workspaces(0).CreateDatabase("C:\ATEST.MDB", _
dbLangGeneral, dbEncrypt)
DB.NewPassword "", "aaa"
' Create new TableDef.
Set tblDef = DB.CreateTableDef("Table1")
' Add field to tblDef.
Set fld = tblDef.CreateField("Field1", dbInteger)
tblDef.Fields.Append fld
' Save TableDef definition by appending it to TableDefs collection.
DB.TableDefs.Append tblDef
DB.Close
MsgBox "ATEST.MDB and Table1 is created."
End Sub
Additional query words: kbVBp400 kbVBp600 kbdse kbDSupport kbVBp Kbstream kbdao
Keywords :
Version :
Platform : NT WINDOWS
Issue type :
Last Reviewed: June 22, 1999