Indigo Rose Software
  #1  
Old 10-18-2004
gbrown's Avatar
gbrown gbrown is offline
Forum Member
 
Join Date: May 2003
Location: St. Paul, MN
Posts: 540
Huh? Password Protect ADO Database in VB6.0

I feel like such a dork (so what's new, eh?). I'm just fine opening an Access database with ADO using the "Jet OLEDBatabase Password=aardvark" kind of thing. All well and good for a database I protect using Access itself. I am at a loss as to how to change/remove the password programatically from within VB6. With DAO it was a piece of cake. I've tried all my usual sources on line, but to no avail. I know it's gonna be so simple I'm going to kick myself...

Thanks, all.
__________________
Gary Brown
Examiner Corporation
"How do you know
They know what they know?"

Company:The Examiner
Glass:FusedLight
Politics:ObamaUSA
Reply With Quote
  #2  
Old 10-18-2004
gbrown's Avatar
gbrown gbrown is offline
Forum Member
 
Join Date: May 2003
Location: St. Paul, MN
Posts: 540
Peekaboo!

I just knew it.... as soon as I posted the note I found the solution. As guessed, pretty simple:

--------------------------------------------
Dim strSourceDB As String
Dim strDestDB As String
Dim JetEngine As JRO.JetEngine
Dim strSourceConnect As String
Dim strDestConnect As String

' Build connection strings for SourceConnection and
' DestConnection arguments.

strSourceDB = "original.mdb"
strSourceConnect = "Data Source=" & strSourceDB & ";Jet OLDEDBatabase Password=OldPassword"

strDestDB = "newdb.mdb"
strDestConnect = "Data Source=" & strDestDB & ";" & _
"Jet OLEDB:Encrypt Database=True;" & _
"Jet OLEDBatabase Password=NewPassword"

Set JetEngine = New JRO.JetEngine

' Compact and encrypt the database specified by strSourceDB
' to the name and path specified by strDestDB.
JetEngine.CompactDatabase strSourceConnect, strDestConnect


Set JetEngine = Nothing

---------------------------
*sigh*
__________________
Gary Brown
Examiner Corporation
"How do you know
They know what they know?"

Company:The Examiner
Glass:FusedLight
Politics:ObamaUSA
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protect a setup? me0007 Setup Factory 6.0 1 06-29-2004 04:59 PM
Adding Password Protection Desmond AutoPlay Media Studio 5.0 Examples 0 10-03-2003 04:25 PM
Reoccurring password Bruce AutoPlay Media Studio 4.0 6 06-04-2003 05:09 PM
Password Bruce AutoPlay Media Studio 4.0 2 05-31-2003 06:52 PM
HOWTO: Add Password Protection to Your Application Support AutoPlay Media Studio 4.0 Examples 0 10-03-2002 04:39 PM


All times are GMT -6. The time now is 06:12 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software