Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB/Access Security
Message
 
À
19/07/2000 14:13:36
Michael Tustison
Professional Services Industries
Homewood, Illinois, États-Unis
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00394446
Message ID:
00394828
Vues:
13
>I'm trying to secure an Access 97 database with a database-level password so that it can only be opened from a VB6 application using an ADO DataControl with the following code...
>
>
>Const mstrDBPATH As String = App.Path & "\MyDB.mdb"
>Const mstrPASSWORD As String = "test"
>Const mstrUSER As String = "admin"
>
>Private Sub Form_Load()
>
> With adoArticle
> .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Persist Security Info=True;Data Source=" & mstrDBPATH & _
> "; Mode=Read|Write"
> .CursorLocation = adUseClient
> .CursorType = adOpenStatic
> .CommandType = adCmdText
> .RecordSource = "SELECT * FROM Articles Order By Title"
> .UserName = mstrUSER
> .Password = mstrPASSWORD
> .Refresh
> End With
>End Sub
>
>
>I get the following error message...
>
>
>ErrorNumber: 3661
>Scode: -2147217843
>Description: Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
>
>
>However, the workgroup information file is NOT missing or opened. What am I doing wrong? Do I need to set up user-level security? Is my ConnectionString syntax incorrect? I'd be very grateful for any clues whatsoever.
>

What have you done to set security? Have you set a Databse Password?

In this case, you should use this syntax for the connection string:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\Nwind.mdb;Persist Security Info=False;Jet OLEDB:Database Password=YourPasswordHerer

And don't set the UserName and Password property.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform