Ms Access Error 3031
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error 3031 - not a valid password up vote 0 down vote favorite I am trying to access an MDB file via VB6 and receiving: Error 3031 - not a valid password What is the likely cause? I believe I am sending the correct password of the file yet it produces this error. ms-access vb6 share|improve this question asked May 15 '12 at 4:12 CJ7 4,99232114220 better connect thru ODBC –Rhian A May 15 '12 at 4:38 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote CAUSE: When you manually set the database password to a password with fourteen characters (the limit), you cannot use that same password to programmatically open the database SOLUTION: 1: Do not select a password that is longer than 13 characters if you need to open the database programmatically. 2: When you open the database programmatically, you need only include the first 13 characters of the database password. To make the example in the "Steps to Reproduce Problem" section work, change the following line of code Set db = ws.OpenDatabase _ ("C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb", _ False, False, "MS Access;PWD=FourteenCharac") to read as follows: Set db = ws.OpenDatabase _ ("C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb", _ False, False, "MS Access;PWD=FourteenChara") NOTE: This will programmatically open the Northwind.mdb database even though the password is not correct. share|improve this answer edited Aug 24 '12 at 6:07 answered Jun 11 '12 at 9:53 hims056 17.9k1664101 add a comment| Your Answer draft saved draft discarded Sign up or l
a Question Need help? Post your question and get tips & solutions from a community of 418,595 IT Pros & Developers. It's quick & easy. OpenDatabase - Error 3031 - Not a valid password Expert Mod 15k+ P: 29,923 NeoPa In my code : Expand|Select|Wrap|Line Numbers strConnect=Replace("MSAccess;PWD=%P","%P",Scramble(conLinkPW)) SetdbThat=wsVar.OpenDatabase(Name:=strDBPath,_ Options:=True,_ Connect:=strConnect) the variable strConnect is set up with a perfectly valid string - correctly formatted. My code doesn't use visible password strings but I was able to http://stackoverflow.com/questions/10594046/error-3031-not-a-valid-password test the value and it matched the database password exactly : Expand|Select|Wrap|Line Numbers MSAccess;PWD=XXXXX The code above kept failing with the error : Expand|Select|Wrap|Line Numbers Run-timeerror3031: Notavalidpassword. I've tried all sorts of variations of the string, but all with the same results. How to use the OpenDatabase method to open password-protected databases in Access 2000 indicates how this string https://bytes.com/topic/access/answers/946754-opendatabase-error-3031-not-valid-password should be formatted, and mine matches that perfectly. Feb 10 '13 #1 Post Reply ✓ answered by NeoPa I did some more Googling (I'd already done a fair bit before posting of course.) and found myself back at the same link (How to use the OpenDatabase method to open password-protected databases in Access 2000). This time though, I noticed something very important that wasn't well highlighted (No surprise - It was pointing out an error in the Help file) : Link: NOTE: Even though the Options and Read-Only arguments of the OpenDatabase method are documented in Help as being optional arguments, you must provide them when you use the Connect argument. The following code therefore works perfectly : Expand|Select|Wrap|Line Numbers strConnect=Replace("MSAccess;PWD=%P","%P",Scramble(conLinkPW)) SetdbThat=wsVar.OpenDatabase(Name:=strDBPath,_ Options:=True,_ ReadOnly:=False,_ Connect:=strConnect) Share this Question 3 Replies Expert Mod 15k+ P: 29,923 NeoPa I did some more Googling (I'd already done a fair bit before posting of course.) and found myself back at the same link (How to use the OpenDatabase method to open password-protected databases in Access 2000). This time th
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a https://www.experts-exchange.com/questions/24080184/run-time-error-3031.html Full Time Job Ways to Get Help Expand Search Submit Close Search Login http://p2p.wrox.com/access/59941-not-valid-password-error-3031-a.html Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > run time error 3031 Want to Advertise Here? Solved run time error 3031 Posted on 2009-01-24 Visual Basic Classic MS Access MS Excel 1 Verified Solution 2 Comments 546 Views Last Modified: 2012-05-06 ms access Hi, I creted procedure in order to provide users to change password using UserForm in Excel. Password is updated in MS Access table named USers. Following procedure works OK until I have not set password for my Access db. After I set password for my Access db31.mdb I have this Run Time error 3031. For this Function I'm using DAO. Here is VBA code Public ms access error Function UpdatePassword(ByVal UserName As String, ByVal password As String, ByVal noviPassword As String) Dim cnt As ADODB.Connection Dim rs As ADODB.Recordset Dim dbs As Database Dim stDB, user, stConn As String Dim strSQL As String stDB = "C:\db\db31.mdb" Set cnt = New ADODB.Connection Set rs = New ADODB.Recordset stConn = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=xyz;" _ & "Data Source=" & stDB & ";" Set dbs = OpenDatabase(stDB) strSQL = "UPDATE USERS SET PASSWORD = '" & noviPassword & "' WHERE USERNAME = '" & UserName & "' and PASSWORD = '" & password & "'" dbs.Execute (strSQL) FrmChangePassword.Hide MsgBox "Password changed", vbInformation, "Password Validation" End Function I would appreciate If anyone can adjust my above VBA code in order to make this working with set db password in MS Access. (Attention: db password is FSC123) Thank you very much in advance.... Kind regards 0 Question by:garfild_1 Facebook Twitter LinkedIn Google LVL 38 Best Solution bypuppydogbuddy see if this link helps: http://support.microsoft.com/kb/192028 Go to Solution 2 Comments LVL 38 Overall: Level 38 MS Access 33 Visual Basic Classic 8 MS Excel 8 Message Accepted Solution by:puppydogbuddy2009-01-24 see if this link helps: http://support.mi
Unanswered Topics Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access Not a valid password. (Error 3031) User Name Remember Me? Password Reminder Password Register Register | FAQ | Members List | Calendar | Today's Posts | Search Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. Search Forums Show Threads Show Posts Advanced Search Find All Thanked Posts Go to Page... Welcome to the p2p.wrox.com Forums. You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free . Thread Tools Display Modes #1 (permalink) July 10th, 2007, 02:43 AM ybg1 Authorized User Points: 110, Level: 2 Activity: 0% Join Date: Jul 2007 Location: , , . Posts: 22 Thanks: 0 Thanked 0 Times in 0 Posts Not a valid password. (Error 3031) -------------------------------------------------------------------------------- Created an Access database and program standalone, that are splited, and the tables are linked to the program. I've setup a password on the database tabes. When I open the program I get "Not a valid password. (Error 3031)". How can I get over this problem and still have a password set? #2 (permalink) July 10th, 2007, 06:33 AM mmcdonal Friend of Wrox Points: 9,611, Level: 42 Activity: 0% Join Date: Mar 2004 Location: Washington, DC, USA. Posts: 3,069 Thanks: 0 Thanked 10 Times in 10 Posts Which part is pass