Connecting Tech Pros Worldwide Forums | Help | Site Map

Creating secure database with ADOX

devonknows's Avatar
Familiar Sight
 
Join Date: Nov 2006
Posts: 137
#1: Jan 3 '07
Hi can any one please help me with creating a secure database with ADO or ADOX if possible, ive got this code already but its not accessible through VisData so i cant easily modify it at all.

Expand|Select|Wrap|Line Numbers
  1. Public Function CreateDatabase()
  2. Dim cat As ADOX.Catalog
  3. Dim tbl As ADOX.Table
  4. Dim con As ADODB.Connection
  5.  
  6.     On Error Resume Next
  7.     Kill txtDatabaseName.Text
  8.     On Error GoTo 0
  9.  
  10. Set cat = New ADOX.Catalog
  11.  
  12.     cat.Create _
  13.         "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  14.         "Data Source=" & QueryValue(rk, "InstallDir") & "\CD Database.mdb;"
  15.  
  16.     Set con = Nothing
  17.     Set tbl = Nothing
  18.     Set cat = Nothing
  19.     MsgBox "Done"
  20. End Function
  21.  
but that doesnt make it secure and also can someone tell me how to access a secure database with ado.

Any help would be much appreciated.

Kind Regards
Devon.
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,866
#2: Jan 3 '07

re: Creating secure database with ADOX


Devon,

I'm not sure exactly what you meant by your question but the following is a link to a comprehensive access security tutorial.

Mary

http://www.jmwild.com/Accesssecurity.htm
devonknows's Avatar
Familiar Sight
 
Join Date: Nov 2006
Posts: 137
#3: Jan 4 '07

re: Creating secure database with ADOX


Ok,sorry about that.

What im trying to do is create a secure database with ADOX.

The Script that is shown above creates the database but does not create a secure database, ( as in secure i mean not able to access it outside of the application or password protected )

Also

The database the above code creates will not load in the Add-In for VB6 called VisData which allows you to design your database.

i hope that explains a little better

Kind Regards.
Devon.
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,866
#4: Jan 4 '07

re: Creating secure database with ADOX


Quote:

Originally Posted by devonknows

Ok,sorry about that.

What im trying to do is create a secure database with ADOX.

The Script that is shown above creates the database but does not create a secure database, ( as in secure i mean not able to access it outside of the application or password protected )

Also

The database the above code creates will not load in the Add-In for VB6 called VisData which allows you to design your database.

i hope that explains a little better

Kind Regards.
Devon.

Our VB experts may be able to help you further. You could try posting a link in the Visual Basic forum.

Mary
Newbie
 
Join Date: Jan 2007
Posts: 3
#5: Jan 26 '07

re: Creating secure database with ADOX


Devon, all you should have to to is add the: ";Jet OLEDB:Database Password=[password_here];" to the end of your connection string, like this:



ADOX.Catalog cat.Create _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & QueryValue(rk, "InstallDir") & "\CD Database.mdb;" & _
"Jet OLEDB:Database Password=[password_here];"
Reply