?
Solved

Snytax for password

Posted on 2006-03-27
7
Medium Priority
?
233 Views
Last Modified: 2012-05-05
Could you please tell me the Correct snytax for the password statement.  Using two different statements.  


1.

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
        "Data Source=\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Volume.mdb;" & "Password=Opps;"

2.
Set App = GetObject("\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Volume.mdb") & "Password=OPPs;"

Thank you!!!
0
Comment
Question by:ca1358
7 Comments
 
LVL 3

Expert Comment

by:ptan218
ID: 16307328
1. cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
        "Data Source=\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Volume.mdb;" & "pwd=Opps;"

2. Set App = GetObject("\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Volume.mdb") & "pwd=OPPs;"
0
 
LVL 9

Expert Comment

by:Naveen Swamy
ID: 16308054
0
 
LVL 11

Expert Comment

by:Ved Prakash Agrawal
ID: 16309330

Dim cn as new adodb.connection

1.
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
        "Data Source=\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Volume.mdb;Pwd=Opps;"

2.
Set App = GetObject("\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Volume.mdb;Pwd=Opps;")
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Accepted Solution

by:
Leo Eikelman earned 2000 total points
ID: 16313249
you can do this a few ways

I think this is a better method personally.  It's easier to read.

Dim cn As New ADODB.Connection
cn.Provider = "Microsoft Jet 4.0 OLE DB Provider"
cn.ConnectionString = "Data Source=\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Volume.mdb"
cn.Properties("Jet OLEDB:Database Password") = "Opps"
cn.Open

If you wanted to do it your way it is

1. cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
        "Data Source=\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Volume.mdb;" & "OLEDB:Database Password=Opps"

2.  Set App = GetObject("\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Volume.mdb;pwd=OPPs;")


Cheers,

Leo
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16315107
I've paid VAT. I've paid Income tax. I've paid the sin tax. I'm buggered if I now have to pay the sny tax. ;)
0
 

Author Comment

by:ca1358
ID: 16315781
thank you!
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16315835
You're welcome :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

850 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