By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 946 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Using login info to open a Connection object

P: n/a
I have created an Access DB and a new MDW file where I have admin
privileges. I have several tables and a form that interacts with them.
When I click the "Submit" button on the form, I have it programmed to
send data to two different tables. However, when I try to run it, I
get "Not a Valid user name or password".

My connection string is as follows:
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
& CurrentProject.Path & "\OnlineOrderSystem.mdb;Jet OLEDB:System
Database=" & CurrentProject.Path & "\ONLINEORDERS.MDW"

How can I set up the form so that I don't have to hard code my user
name and password, and the user or user group's permissions level is
used to authenticate and connect? I know that the hard-coding works,
but it seems bad practice to me to have to do that. I know I can use
CurrentUser to get the user's name, but I haven't found any way to get
their password value.

I tend to get less-than-helpful answers here, which only lets me know
that I ask questions poorly (I guess). If you need more information,
please state this before giving an answer that isn't a solution. Thank
you.

Oct 20 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 20 Oct 2006 07:45:20 -0700, bl*****@carolina.rr.com wrote:

Since you say "Submit", I'm assuming you're writing a web app against
a secured Access db. It would be helpful to state your programming
environment and language.

Your connection string is incomplete. It does not specify the User and
Password to login with. You can of course add those items at runtime
as it seems you were planning on doing. If you don't want to use
hard-coded values, you'll have to prompt the user for them.

Passwords typically are not recoverable. Not sure what you had in mind
there. Perhaps CurrentProject.Connection will be helpful for you: a
ready-to-go connection object.

-Tom.

>I have created an Access DB and a new MDW file where I have admin
privileges. I have several tables and a form that interacts with them.
When I click the "Submit" button on the form, I have it programmed to
send data to two different tables. However, when I try to run it, I
get "Not a Valid user name or password".

My connection string is as follows:
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
& CurrentProject.Path & "\OnlineOrderSystem.mdb;Jet OLEDB:System
Database=" & CurrentProject.Path & "\ONLINEORDERS.MDW"

How can I set up the form so that I don't have to hard code my user
name and password, and the user or user group's permissions level is
used to authenticate and connect? I know that the hard-coding works,
but it seems bad practice to me to have to do that. I know I can use
CurrentUser to get the user's name, but I haven't found any way to get
their password value.

I tend to get less-than-helpful answers here, which only lets me know
that I ask questions poorly (I guess). If you need more information,
please state this before giving an answer that isn't a solution. Thank
you.
Oct 20 '06 #2

P: n/a
The form is an MS Access form, contained in the same database as the
tables they are writing to.

CurrentProject.Connection absolutely did the trick! And THANK YOU for
actually answering the question, as opposed to a previous post I had
where the "helper" had me rewriting my entire app, instead of simply
telling me this. Consider this resolved.

Tom van Stiphout wrote:
On 20 Oct 2006 07:45:20 -0700, bl*****@carolina.rr.com wrote:

Since you say "Submit", I'm assuming you're writing a web app against
a secured Access db. It would be helpful to state your programming
environment and language.

Your connection string is incomplete. It does not specify the User and
Password to login with. You can of course add those items at runtime
as it seems you were planning on doing. If you don't want to use
hard-coded values, you'll have to prompt the user for them.

Passwords typically are not recoverable. Not sure what you had in mind
there. Perhaps CurrentProject.Connection will be helpful for you: a
ready-to-go connection object.

-Tom.

I have created an Access DB and a new MDW file where I have admin
privileges. I have several tables and a form that interacts with them.
When I click the "Submit" button on the form, I have it programmed to
send data to two different tables. However, when I try to run it, I
get "Not a Valid user name or password".

My connection string is as follows:
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
& CurrentProject.Path & "\OnlineOrderSystem.mdb;Jet OLEDB:System
Database=" & CurrentProject.Path & "\ONLINEORDERS.MDW"

How can I set up the form so that I don't have to hard code my user
name and password, and the user or user group's permissions level is
used to authenticate and connect? I know that the hard-coding works,
but it seems bad practice to me to have to do that. I know I can use
CurrentUser to get the user's name, but I haven't found any way to get
their password value.

I tend to get less-than-helpful answers here, which only lets me know
that I ask questions poorly (I guess). If you need more information,
please state this before giving an answer that isn't a solution. Thank
you.
Oct 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.