vba - submit data from excel userform to password protected access database -


i trying submit userform data excel (2013) access database.

without password, code works fine.

private sub addoer_click() dim cnn adodb.connection dim rst adodb.recordset dim dbpath  dbpath = sheet16.range("k18").value  set cnn = new adodb.connection cnn.open "provider=microsoft.ace.oledb.12.0;data source=" & dbpath 

now trying use same method send data excel password protected database (each user has different password). in excel file, user id @ sheet16.range("k17") , password @ sheet16.range("k19")

userid = sheet16.range("k17").value pw = sheet16.range("k19").value 

i changed cnn.open line following

cnn.open "provider=microsoft.ace.oledb.12.0;" & _ "data source=" & dbpath, userid, pw, -1 

and getting error:

error -2147217843 (cannot start application.the workgroup information file missing or open exclusively user.)

i changed cnn.open line this

cnn.open "provider=microsoft.ace.oledb.12.0;data source=" & dbpath, """ & userid & """, """ & pw & """, -1 

and error

error -2147217843 (not valid account name or password).

is there can point did wrong?

your second attempt doesn't work, because passing in username "user" when username user.

regarding first attempt, found note @ connectionstrings.com:

note! reports database encrypted using access 2010 - 2013 default encryption scheme not work connection string. in access; try options , choose 2007 encryption method instead. should make work.

also, database opened exclusively connection / program? if have database open in access , can design tables / queries, iirc means have exclusive access database, , no other connections can connect it. see .laccdb (or .ldb) file in same folder access database?

references:


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -