[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

ConsoleApplication - Opening Password Protected Database.

ardy

9/9/2011 1:42:00 PM

Hello All:
I also have posted this under microsoft.public.vb.database, haven't
gotten any response. I am hoping I have
a better luck here, I hope.
I have created a database (access 2007) that is entirely driven by
forms. I want all users to interact through forms and input data and
or information in the tables. it is all working fine. My issue is
that if I password protect the database(Open Exclusive). I need to
pass the password some how through forms and or VB code to open the
database and let users work with the forms and do their thing. I
came
up with two simple option relizing that I can expand the forms to
incorporate a user and password approach, but in retrospective our
group is very small and the following method works well and less
coding.
1) use command line switches (/pwd) and pass the password. embed
this
into a Console application. and give users a single X.exe to open the
database, but I found out that /pwd is no longer available in access
2007. so this brings me to option two which I stuck on.......
2)utilizing the same CounsoleApplication but some how pass the
password programmaticly. I have searched and serched and all options
are using ODBC and I wonder is there a way to just pass the password
once the dialog box shows up. this is the code I am using to open
the
database.
---------------------Start code--------------
Module Module1
Sub Main()
OpenMicrosoftAccess("C:\GWM\CallTracker\Development_Files
\Ver-3.1\SC_Testing.accdb")
End Sub
''' <summary>
''' Open the path parameter with Microsoft Access.
''' </summary>
Private Sub OpenMicrosoftAccess(ByVal f As String)
Dim startInfo As New ProcessStartInfo
startInfo.FileName = "MSACCESS.EXE"
startInfo.Arguments = f
Process.Start(startInfo)
End Sub
Private Function OpenMicrosoftAccess(ByVal DBPath As String,
ByVal
p2 As Boolean, ByVal p3 As Boolean, ByVal p4 As String) As DataSet
Throw New NotImplementedException
End Function
End Module
-----------------------------End Code------------
8 Answers

GS

9/9/2011 2:38:00 PM

0

ardy presented the following explanation :
> Hello All:
> I also have posted this under microsoft.public.vb.database, haven't
> gotten any response. I am hoping I have
> a better luck here, I hope.
> I have created a database (access 2007) that is entirely driven by
> forms. I want all users to interact through forms and input data and
> or information in the tables. it is all working fine. My issue is
> that if I password protect the database(Open Exclusive). I need to
> pass the password some how through forms and or VB code to open the
> database and let users work with the forms and do their thing. I
> came
> up with two simple option relizing that I can expand the forms to
> incorporate a user and password approach, but in retrospective our
> group is very small and the following method works well and less
> coding.
> 1) use command line switches (/pwd) and pass the password. embed
> this
> into a Console application. and give users a single X.exe to open the
> database, but I found out that /pwd is no longer available in access
> 2007. so this brings me to option two which I stuck on.......
> 2)utilizing the same CounsoleApplication but some how pass the
> password programmaticly. I have searched and serched and all options
> are using ODBC and I wonder is there a way to just pass the password
> once the dialog box shows up. this is the code I am using to open
> the
> database.
> ---------------------Start code--------------
> Module Module1
> Sub Main()
> OpenMicrosoftAccess("C:\GWM\CallTracker\Development_Files
> \Ver-3.1\SC_Testing.accdb")
> End Sub
> ''' <summary>
> ''' Open the path parameter with Microsoft Access.
> ''' </summary>
> Private Sub OpenMicrosoftAccess(ByVal f As String)
> Dim startInfo As New ProcessStartInfo
> startInfo.FileName = "MSACCESS.EXE"
> startInfo.Arguments = f
> Process.Start(startInfo)
> End Sub
> Private Function OpenMicrosoftAccess(ByVal DBPath As String,
> ByVal
> p2 As Boolean, ByVal p3 As Boolean, ByVal p4 As String) As DataSet
> Throw New NotImplementedException
> End Function
> End Module
> -----------------------------End Code------------

Simply prompt the user to enter the password BEFORE opening the mdb.

-OR-

When the mdb first opens prompt the user for the password before any
forms are accessed. You can store the password for that user using
VBA's SaveSetting() function so you can retrieve it on subsequent
startups using VBA's GetSetting() function. If the password is
incorrect then shut down the mdb using 'Application.Quit'!

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Jeff Johnson [MVP: VB]

9/9/2011 2:57:00 PM

0

"ardy" <ardy.ghoreishi@gmail.com> wrote in message
news:c26a3efc-53ba-4fea-b2c4-3d8103db1956@u6g2000prc.googlegroups.com...

> Throw New NotImplementedException

--
[Canned response]

This is a VB "classic" newsgroup. Questions about VB.NET (including VB
2005/2008 and VB Express, which have dropped .NET from their names) are
off-topic here.

Please ask .NET questions in newsgroups with "dotnet" in their names. The
*.vb.* groups are for VB6 and earlier.

For questions specific to the VB.NET language, use this group:

microsoft.public.dotnet.languages.vb

Please note that things like controls and data access, which have their own
subgroups in the Classic VB hierarchy, are not language-specific in .NET, so
you should look for groups like these:

microsoft.public.dotnet.framework.windowsforms.controls
microsoft.public.dotnet.framework.adonet

(Note that "vb" is not present in the group name.)


GS

9/9/2011 3:04:00 PM

0

on 9/9/2011, Jeff Johnson supposed :
> "ardy" <ardy.ghoreishi@gmail.com> wrote in message
> news:c26a3efc-53ba-4fea-b2c4-3d8103db1956@u6g2000prc.googlegroups.com...
>
>> Throw New NotImplementedException
>
> --
> [Canned response]
>
> This is a VB "classic" newsgroup. Questions about VB.NET (including VB
> 2005/2008 and VB Express, which have dropped .NET from their names) are
> off-topic here.
>
> Please ask .NET questions in newsgroups with "dotnet" in their names. The
> *.vb.* groups are for VB6 and earlier.
>
> For questions specific to the VB.NET language, use this group:
>
> microsoft.public.dotnet.languages.vb
>
> Please note that things like controls and data access, which have their own
> subgroups in the Classic VB hierarchy, are not language-specific in .NET, so
> you should look for groups like these:
>
> microsoft.public.dotnet.framework.windowsforms.controls
> microsoft.public.dotnet.framework.adonet
>
> (Note that "vb" is not present in the group name.)

Geez.., I didn't bother to look closely that OP wasn't using Classic
VB!

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc


ardy

9/9/2011 3:16:00 PM

0

On Sep 9, 7:57 am, "Jeff Johnson" <i....@enough.spam> wrote:
> "ardy" <ardy.ghorei...@gmail.com> wrote in message
>
> news:c26a3efc-53ba-4fea-b2c4-3d8103db1956@u6g2000prc.googlegroups.com...
>
> >        Throw New NotImplementedException
>
> --
> [Canned response]
>
> This is a VB "classic" newsgroup. Questions about VB.NET (including VB
> 2005/2008 and VB Express, which have dropped .NET from their names) are
> off-topic here.
>
> Please ask .NET questions in newsgroups with "dotnet" in their names. The
> *.vb.* groups are for VB6 and earlier.
>
> For questions specific to the VB.NET language, use this group:
>
> microsoft.public.dotnet.languages.vb
>
> Please note that things like controls and data access, which have their own
> subgroups in the Classic VB hierarchy, are not language-specific in .NET, so
> you should look for groups like these:
>
> microsoft.public.dotnet.framework.windowsforms.controls
> microsoft.public.dotnet.framework.adonet
>
> (Note that "vb" is not present in the group name.)

Thanks for the info
I will post in the right group.........

Jeff Johnson [MVP: VB]

9/9/2011 5:33:00 PM

0

"GS" <gs@somewhere.net> wrote in message news:j4d9t8$kk0$1@dont-email.me...

> Geez.., I didn't bother to look closely that OP wasn't using Classic VB!

Actually, I was pretty sure the moment I saw "ConsoleApplication" in the
subject line....


GS

9/9/2011 8:45:00 PM

0

Jeff Johnson explained :
> "GS" <gs@somewhere.net> wrote in message news:j4d9t8$kk0$1@dont-email.me...
>
>> Geez.., I didn't bother to look closely that OP wasn't using Classic VB!
>
> Actually, I was pretty sure the moment I saw "ConsoleApplication" in the
> subject line....

I thought Classic VB *could* create console apps, and so I interpreted
that as an object ref. Otherwise, I would know vb.net by that alone.

Regardless, the suggestions I gave in my post about the
'frontloader.exe' would apply in any language being used to automate
Access, *and* the VBA suggestions are valid for Access.<g>

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Jeff Johnson [MVP: VB]

9/9/2011 8:51:00 PM

0

"GS" <gs@somewhere.net> wrote in message news:j4dtt2$6sh$1@dont-email.me...

>>> Geez.., I didn't bother to look closely that OP wasn't using Classic VB!
>>
>> Actually, I was pretty sure the moment I saw "ConsoleApplication" in the
>> subject line....
>
> I thought Classic VB *could* create console apps, and so I interpreted
> that as an object ref.

It can, but the term is FAR more common in the .NET world. "When you hear
hoofbeats, you don't assume zebras."


GS

9/9/2011 9:06:00 PM

0

Jeff Johnson formulated the question :
> "GS" <gs@somewhere.net> wrote in message news:j4dtt2$6sh$1@dont-email.me...
>
>>>> Geez.., I didn't bother to look closely that OP wasn't using Classic VB!
>>>
>>> Actually, I was pretty sure the moment I saw "ConsoleApplication" in the
>>> subject line....
>>
>> I thought Classic VB *could* create console apps, and so I interpreted that
>> as an object ref.
>
> It can, but the term is FAR more common in the .NET world. "When you hear
> hoofbeats, you don't assume zebras."

Ha, ha! True enough. However, any code posted here would have to look
enough like a foreign language for me to catch that it's NOT classic
VB. IOW, I'm not familiar with vb.net at all AND consider myself a
novice classic VBer. Oh, I've caught the obvious posts but a few, like
this one, got bye me real easy!<g>

As for the hoof beats comment; when I'm heard those hoof beats in a
horse paddock I'd assume horses. Ergo, classic vb forum assumes classic
vb postings unless otherwise obvious.<g>

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc