|
-
Apr 19th, 2007, 06:06 PM
#1
Thread Starter
Addicted Member
[RESOLVED] open a password protected access db
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
-
Apr 19th, 2007, 06:19 PM
#2
Re: open a password protected access db
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 19th, 2007, 06:24 PM
#3
Thread Starter
Addicted Member
Re: open a password protected access db
I want to open the db not to connect.
Is it possible?
Last edited by r_amin; Apr 19th, 2007 at 06:34 PM.
-
Apr 19th, 2007, 06:45 PM
#4
Re: open a password protected access db
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
Last edited by RobDog888; Apr 19th, 2007 at 06:54 PM.
Reason: added line of code lol.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 19th, 2007, 06:52 PM
#5
Thread Starter
Addicted Member
Re: open a password protected access db
Sorry! how do i creat object? please.
-
Apr 19th, 2007, 06:55 PM
#6
Re: open a password protected access db
Lol, sorry, just typed the code in the reply box and just realized I forgot that line. Post updated.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 19th, 2007, 07:39 PM
#7
Thread Starter
Addicted Member
Re: open a password protected access db
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
-
Apr 19th, 2007, 07:47 PM
#8
Re: open a password protected access db
You need to add the createobject line of code that I updated earlier and mentioned already. You are not using the updated code.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 19th, 2007, 11:34 PM
#9
Thread Starter
Addicted Member
Re: open a password protected access db
-
Apr 19th, 2007, 11:39 PM
#10
Re: open a password protected access db
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|