Solved

Vb6, Opening Access2000 Ado, with Password

Posted on 2001-08-28
3
283 Views
Last Modified: 2008-03-03
I had my program running perfectly, *until* i added a password to the Access2000 database.
ie. Open in Exclusive Mode, Security... Add the password
=============================
The Password  is   boss
=============================

(Problem 1)
Global rs As ADODB.Recordset
Global cnn As New ADODB.Connection

Function Opit()
cnn.Provider = "Microsoft.Jet.OLEDB.4.0;"
This does not work  .Cannot find installable ISAM.
'cnn.Open Trim(App.Path) & "\accesswol.mdb" & ";" & "Password=" & "boss"
This works if there is no password..
cnn.Open Trim(App.Path) & "\accesswol.mdb"

Set rs = New ADODB.Recordset
rs.Open "wol", cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect

**
From Help i see.
cnn2.Open "C:\Samples\northwind.mdb", "admin", ""
Is admin a user id, how do i know what the userid is??
-----------------------------------------
(Problem 2)
also, i am opening Access2000 in a DataRecord Area, how do i do this with a password...
DataEnvironment1.Connection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Trim(App.Path) & "\accesswol.MDB" & ";Persist Security Info=False"
-----------------------------------------

When fooling around, i did at some instances get an error refering to workgroup user !!!
User ID=sa;Password=pwd;"
What is User id ????



Appreciate any advice..

0
Comment
Question by:turnerrob
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
Julian_K earned 75 total points
ID: 6434354
Hi :-)
You have too many questions ;-), but about the password:
Include this into your connection string:

Jet OLEDB:Database Password=boss;

Like:

private Connection1 as ADODB.Connection

private sub Connect(byval strDBFileName as string)
    dim strCnn as string
    strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=boss;Data Source=" & strDBFileName
    Set Connection1 = New ADODB.Connection
    Connection1.Open strCnn
end sub

Hope this helps.
0
 
LVL 5

Expert Comment

by:Julian_K
ID: 6434365
User ID is the user name.
You can define some Users to accsess the DataBase, with specific permissions (Read-Only, Write, Modify, etc.)
You should read some Access' help ;-)
0
 

Author Comment

by:turnerrob
ID: 6434434
Thanks for your help.

Have the password section finally going.!!!


Regards  Turnerrob
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question