473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

connecting to password protected backend

I have a frontend that has some tables which are linked to a backend.
Now I want to make the backend password protected and when I try to
run it password protected I can't open it. In the first form that
opens in the front end, I added the following to the form_open event:

Dim cnn As ADODB.connection

Set cnn = New ADODB.connection
cnn.Provider = "Microsoft.Jet.OLEDB.4.0"
cnn.Properties("Data Source") = "C:\backend.mdb"
cnn.Properties("Jet OLEDB:Database Password") = "password"
cnn.Open
'Set cnn = Nothing

It seems like it is running the code but not opening up the links or
not keeping the connection open. After I run this code and I click on
one of the linked tables I get the message "Not a valid password". How
can I get it to work as if there was no password on the backend? I
posted this message on this newsgroup and was told to remove the Set
cnn = Nothing but that doesn't fix things. I also tried DAO Tabledefs
and played around with .RefreshLink but I can't seem to sort out the
problem. I'm sure someone knows how to do this.
Thanx,
Chris
Nov 12 '05 #1
3 6270
Once you put a password on the back-end, delete and recreate your table
links in the front-end. When you recreate them you will be prompted for the
password.

--
Wayne Morgan
Microsoft Access MVP
"Chris" <ch*******@hotmail.com> wrote in message
news:cf**************************@posting.google.c om...
I have a frontend that has some tables which are linked to a backend.
Now I want to make the backend password protected and when I try to
run it password protected I can't open it. In the first form that
opens in the front end, I added the following to the form_open event:

Dim cnn As ADODB.connection

Set cnn = New ADODB.connection
cnn.Provider = "Microsoft.Jet.OLEDB.4.0"
cnn.Properties("Data Source") = "C:\backend.mdb"
cnn.Properties("Jet OLEDB:Database Password") = "password"
cnn.Open
'Set cnn = Nothing

It seems like it is running the code but not opening up the links or
not keeping the connection open. After I run this code and I click on
one of the linked tables I get the message "Not a valid password". How
can I get it to work as if there was no password on the backend? I
posted this message on this newsgroup and was told to remove the Set
cnn = Nothing but that doesn't fix things. I also tried DAO Tabledefs
and played around with .RefreshLink but I can't seem to sort out the
problem. I'm sure someone knows how to do this.
Thanx,
Chris

Nov 12 '05 #2
Thanks Wayne,
Great, it worked. I don't know why I didn't think of that. Another
question. When I delete the linked tables and re-add them and it asks
for the password, i type it in and I can connect to the backend
tables. I then close the frontend and re-open it, it DOESN'T ask for
the password to open the tables. Because I will install this database
on many other machines, I am wondering if it keeps the password for
the backend somewhere in the frontend file or on the computer.

I am currently not at home to fully test all this but I am wondering
two more things:

1) I have code to relink the frontend to another backend (with same
table names) also with a password protect, I am wondering how it will
affect this, whether it will ask for the password when the relink is
being done and whether I can use code similar to what I pasted in the
newsgroup message to do the relink.

2) Do I need the code I used on the form_open event, it seems like I
don't. But it may depend on whether it holds the password in the
frontend file or on the computer.

I will experiment at home but if you know any more about this i'd love
to hear it.

Thanks,
Chris
Nov 12 '05 #3
To the best of my knowledge, the password is stored in the front-end. As
long as you don't change the password and have previously connected with the
password, you should be able to run the reconnect code, but I haven't tried
it. To change the location of the link, you change the Connect property of
the TableDef object. The path must be a valid path and UNC paths are
allowed. If the back-end is on a network share, I would recommend using the
UNC path, it saves the hassel of setting up shared drives. To see if a table
is a linked table, check the Connect property. If it's not null or a zero
length string (I don't remember which right off-hand, but I think it is the
zero length string) then it is a linked table. You can also use the
Attributes property to see if it is a linked table.

You shouldn't need the code in your Open event.

--
Wayne Morgan
MS Access MVP
"Chris" <ch*******@hotmail.com> wrote in message
news:cf**************************@posting.google.c om...
Thanks Wayne,
Great, it worked. I don't know why I didn't think of that. Another
question. When I delete the linked tables and re-add them and it asks
for the password, i type it in and I can connect to the backend
tables. I then close the frontend and re-open it, it DOESN'T ask for
the password to open the tables. Because I will install this database
on many other machines, I am wondering if it keeps the password for
the backend somewhere in the frontend file or on the computer.

I am currently not at home to fully test all this but I am wondering
two more things:

1) I have code to relink the frontend to another backend (with same
table names) also with a password protect, I am wondering how it will
affect this, whether it will ask for the password when the relink is
being done and whether I can use code similar to what I pasted in the
newsgroup message to do the relink.

2) Do I need the code I used on the form_open event, it seems like I
don't. But it may depend on whether it holds the password in the
frontend file or on the computer.

I will experiment at home but if you know any more about this i'd love
to hear it.

Thanks,
Chris

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ifeoma | last post by:
I have a frontend mdb which has tables linked to a backend. When I put a password on the backend, it can't connect at the frontend. How do I get around this? Thanx, Chris
4
by: Chris | last post by:
I have a frontend that has some tables which are linked to a backend. Now I want to make the backend password protected and when I try to run it password protected I can't open it. In the first...
1
by: Chris | last post by:
I have a frontend that has some tables which are linked to a backend. Now I want to make the backend password protected and when I try to run it password protected I can't open it. In the first...
3
by: Chris | last post by:
I have a frontend that has some tables which are linked to a backend. Now I want to make the backend password protected and when I try to run it password protected I can't open it. In the first...
3
by: Tony | last post by:
G'day, With a (Access 2003) database that is split (frontend application and backend datatables) how can I 'pass' a password from the frontend that allows access to the datatables which are...
4
by: Geir Baardsen | last post by:
Hi! 1. I wonder if there is a possibility to open a BackEnd.Db from the opening form, the form e.g.: frmOrders, in the FrontEnd.Db, when the BackEnd.Db is password protected? 2. Do I need to do...
6
by: Mike | last post by:
I have developed a program that has the backend on a server and multiple users have the front end at their individual computers. I know how to set a password on the backend. How can I implement...
4
by: kthiagar | last post by:
Hi I am trying to connect to a password protected access file from VB.NET. I have no problem in connecting to Access, if I remove the password. This is what I am doing: In the server explorer,...
0
by: vanwout | last post by:
Hello, An ASP page on my IIS server converts an uploaded word document to HTML, but I'm having a problem with it failing (hanging and popup requesting password on server!) on password protected...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.