
08-24-2004, 11:46 PM
|
|
Contributor
|
|
Join Date: Aug 2002
Posts: 515
|
|
How do I add password to DB via code?
|
I'm still very inexperienced with ADO, and with my latest project that I'm working on I want the database to have a password; however I am using the code from this thread http://www.xtremevbtalk.com/showthre...threadid=20002 to create the database at runtime through code (Thanks Thinking & usetheforce2), so my question is how/what do I modify in order to give the database a password?
Here's the code from the sample above so that you don't have to download it..
Code:
Public Sub CreateDataBase()
Dim objcat As adox.Catalog
Dim objMyTable As New adox.Table
Set objcat = New adox.Catalog
objcat.Create strConnection
objcat.ActiveConnection = strConnection
With objMyTable
.Name = "MyTable"
.Columns.Append "Name", adVarWChar, 20
.Columns.Append "Address", adVarWChar, 50
.Columns.Append "City", adVarWChar, 50
.Columns.Append "ST", adVarWChar, 20
.Columns.Append "PostalCode", adVarWChar, 20
.Keys.Append "PrimaryKey", adKeyPrimary, "Name"
End With
objcat.Tables.Append objMyTable
Set objMyTable = Nothing
Set objcat = Nothing
End Sub
Thanks.
|
|