Can i open a access Database with a password
as the following way or any other way?
____WordPath = "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.exe"
____Shell WordPath & " """ & ToOpen & """", vbNormalFocus
Printable View
Can i open a access Database with a password
as the following way or any other way?
____WordPath = "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.exe"
____Shell WordPath & " """ & ToOpen & """", vbNormalFocus
You would want to use ADO to connect to your Access databasse and in the connectionstring you would pass the db pwd.
Check out http://www.connectionstrings.com for the connectionstring syntax.
also, the database forum FAQ for an ADO tutorial.
I want to open the db not to connect.
Is it possible?
Since it has, Im assuming its a database level, a password and you dont want to connect to it then adding a reference to Access in your VB 6 project and using the Access Object Model will do.
Create an Acces application objject and use the .OpenCurrentDatabase method passing the password and database location.
vb Code:
Dim oApp As Access.Application Set oApp = CreateObject("Access.Application") oApp.OpenCurrentDatabase "C:\RobDog888.mdb", False, "SomePassword" oApp.Visible = True
Sorry! how do i creat object? please.
Lol, sorry, just typed the code in the reply box and just realized I forgot that line. Post updated.
i have Added "Microsoft Access 10.0 Object Library" reference.
but Now in the Line - oApp.OpenCurrentDatabase "E:\kkkk.mdb", False, "absd23"
massaged an error "Object Veriable or With block veriable not defined"
vb Code:
Dim oApp As Access.Application oApp.OpenCurrentDatabase "E:\kkkk.mdb", False, "absd23" oApp.Visible = True
You need to add the createobject line of code that I updated earlier and mentioned already. You are not using the updated code.
Thank You
No prob, glad to help. :)
Ps, dont forget to Resolve your thread from the thread tools menu so other members will know your question has been answered. ;)