Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My file : C:\Data.mdb
Password : ALT+1029 (me asign special character)

VB
Public Sub connect()
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
    .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Data.mdb;Jet OLEDB:Database Password=ALT+1029;"
    .CursorLocation = adUseClient
    .Open
End With
End Sub


But connect fail. worng pass
Any one help me. thanks
Posted
Updated 29-Apr-13 21:53pm
v3

Try it with:
C#
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Data.mdb;Jet OLEDB:Database Password=♣;"
Alt+1029 is not 'converted' and should be entered as '♣'.

But Connection strings for Access[^] contains the comment
Some reports of problems with password longer than 14 characters. Also that some characters might cause trouble. If you are having problems, try change password to a short one with normal characters.
So using this special character may not work, to test you can do what remark suggest and try a simple password.
 
Share this answer
 
I Thing this will help to you . . .


C#
//---- For Location --------------------------------------------------------------------------------------
public static string strFile = @"C:\db_dataBaseName.accdb";
//--------------------------------------------------------------------------------------------------------
public static string strPass = "password";
public static string connstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + strFile + ";Jet OLEDB:Database Password=" + strPass + ";Persist Security Info=False;";
 
Share this answer
 
Still error . I can not assign symbol in VBA Access

http://nw4.upanh.com/b2.s36.d2/9cca35bc4004d2dc57e7d01a4fbd4a77_55253104.faststoneeditor.bmp[^]

This is a project VB6 + Data ms access 2003 using password symbol :

http://www.mediafire.com/download.php?q627s0645dyvs4j[^]

I want to set password and connect to this file like this project.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900