|
#1
|
|||
|
|||
|
Opening Access in Exclusive mode
Is it possible to access Access in exclusive mode on the same machine VB is running on or the code below is for server use only? I tried to open it on a connection string submitting the right password but I keep getting an error message stating that the password submitted is wrong.
Here is the code used: strConn = "User ID=Admin;Password=Pword;Data Source=" & App.Path & _ "\Access.mdb;Provider=Microsoft.Jet.OLEDB.4.o" Thanks, tibois |
|
#2
|
||||
|
||||
|
I have never seen a connection string where the uid and password were the first two elements. They are always the last two.
Move them to the end of your connection string and try again.
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 |
|
#3
|
|||
|
|||
|
The last character of the Provider should be a zero, not the letter 'o'. That is, change this:
Provider=Microsoft.Jet.OLEDB.4.o to this: Provider=Microsoft.Jet.OLEDB.4.0
__________________
Phil Weber http://www.philweber.com Please post questions to the forums, where others may benefit. I do not offer free assistance by e-mail. Thank you! |
|
#4
|
||||
|
||||
|
Quote:
In VB 6.0, you can open a database password protected by set then Code:
Jet OLEDB:Database Password Example: Code:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ App.Path & "\Access.mdb;Persist Security Info=False;Jet OLEDB:Database Password=Pword Code:
CN.Mode =adModeShareExclusive
__________________
HTH ![]() VBCorner code: MenuCreator add-in + MenuExtended.dll - SaveToFolder add-in - my PSC code: CommonDialog Enhanced Callback - Enumerate Icon Resources - Network Change TCP/IP |
|
#5
|
|||
|
|||
|
Thanks gibra! I just stopped by to do additional research and saw your post; the code works.
tibois |
|
#6
|
||||
|
||||
|
There is a connectionstring syntax for specifying Exclusive mode upon connecting in case you wanted to specify it in one line of code.
Use the ODBC Driver format/syntax. Code:
oCnn.Connectionstring = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & App.Path & "\Access.mdb;Exclusive=1;Uid=Admin;Pwd=Pword;"
__________________
VB/Office Guru™ (AKA: Gangsta Yoda™ I dont answer code questions via PMs. ![]() Microsoft MVP 2006 & 2007 Office Development FAQ (VBA, VB 6, VB.NET, C#) Software Developer MCP (VB 6 & .NET) • Save Ana • Reps & Rating Posts • VS.NET on Vista (New) • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • Outlook Global Address List • API Viewer utility • |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Excel App opening in Browser Window, how to access menus? | OwenDavies | VB Classic | 0 | 03-09-2006 09:40 PM |
| Borland and me: We both want less code and more pictures! | Mike Mitchell | .NET | 60 | 09-13-2002 06:41 PM |
| VBA Access 97 on an Access 2000 PC | Walter Freeman | VB Classic | 3 | 06-19-2002 04:13 AM |
| Will MDAC 2.5 mess up an Access 2 or 95 Developers PC ?? | David Lewinski | VB Classic | 0 | 07-26-2001 05:10 PM |
| Opening a password protected Access Database | Greg Rothlander | VB Classic | 1 | 01-03-2001 03:10 PM |