473,394 Members | 2,002 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,394 software developers and data experts.

Connect to password protected Access 2010 database in Excel

lilp32
43
I need to connect to a password protected Access database through Excel.

Everything I've found while searching seems to imply that this is a bug that Microsoft has not fixed. Is this true? The string I am using is
Expand|Select|Wrap|Line Numbers
  1. Dim cnt as New ADODB.Connection
  2. Dim rst As New ADODB.Recordset
  3. '
  4. cnt.Open "Provider=Microsoft.Ace.OLEDB.12.0;" & _
  5. "Jet OLEDB:Database Password=pw;"Data Source='MyDB.db'"
The error I get is "Not a valid password".

Any suggestions?
Oct 17 '12 #1
5 8178
zmbd
5,501 Expert Mod 4TB
I'm going to leave this string as is so as not to bugger it:
Expand|Select|Wrap|Line Numbers
  1. cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\OpenToNetwork\testDB.accdb;Persist Security Info=False;Jet OLEDB:Database Password=123"
Now I haven't tried this out in every situation and I'm using WINXP(MCE)-SP3; however, it seems that the order and the path are importaint. There are also some issues with WIN7/Vista from what I've heard.
Oct 18 '12 #2
lilp32
43
Thanks, but this is the same as what I am using. It still gives me the "invalid password" message. I am using Win7.
Oct 18 '12 #3
NeoPa
32,556 Expert Mod 16PB
It may give you the same message Lilp, but it's certainly not the same code - even allowing for the fact the the code you posted could never run as it has an extraneous (") in the middle of what looks like a string value. Presumably that's a posting error rather than anything else otherwise the error you reported would be a VBA compilation error rather than a runtime one.

I would guess from what I see here that the issue is an operability one with Win7/Vista (as Z says). I suggest you search online (using the parameters that define your setup) for any published issues. That's not to say that no-one here necessarily knows the answer, but for such a specific issue I wouldn't hold my breath (especially when the alternative is so straightforward and presumably quick).
Oct 18 '12 #4
lilp32
43
Thanks, and yes I am not sure why there is an extra quotation mark in the middle. I see that the suggestion by zmbd is in a different order and has an additional parameter.

You mentioned a quick and straightforward alternative - do you mean removing the password or is there something else I could do? I don't really consider this a specific issue? This seems like an issue many people would have as many databases are password protected.
Oct 18 '12 #5
NeoPa
32,556 Expert Mod 16PB
I was referring to doing a search using parameters specific to your situation. The version of Windows already appears to show as a potential issue, from comments already entered. You're in the best position to do that as you have your system to hand and know which versions of everything you're running. If, as seems likely, this is an interoperational issue then you're in the best position to find information about the problem - assuming no-one here has direct experience of your problem (which position I would estimate as highly likely).

This is all assuming that this actually is a specific issue - which is how it appears to me from what information is available here.
Oct 19 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: webmaster | last post by:
I have a password protected Access Database (.MDB) file. I also have a Crystal Report with database fields connected to table in this database. I want to display the Crystal Report Preview Form...
1
by: www.MSmobiles.com | last post by:
hi, how can I implement passowrd protected access to IIS located files? for example: when somebody tries: http://x.msmobiles.com/a/dupa.pdf
1
by: Daniel | last post by:
Hello everyone, I am trying to connect to a password protected Access database using: Public connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathDB & ";User...
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,...
2
by: iqbalash | last post by:
-------------------------------------------------------------------------------- Please tell me how can I make DSN programatically to a password protected Access DB. Thanks Best Regards,...
2
by: shmsrisampath | last post by:
how to open password protected access file from vb 6.
4
by: larystoy | last post by:
Have password protected a large Access database and when trying to run the program in VB6 am getting following error when trying to run program: Not a valid account name or password ***** ON...
0
by: ncsthbell | last post by:
I have an access 2007 database (ABC) and I want to import a form from a different 2007 access database (DEF). I go into ABC.mdb and I chose 'get external data' and I select 'access' and browse to...
9
by: dexter delleva | last post by:
please can anyone help me? im currently working in a project and i already made a code for the login, the only thing is that i dont know how to update the records(Username/Password) in access using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.