VB6/Access Connection Opening

Posted on 2006-04-12
Last Modified: 2013-12-25
Hi All Experts,

I have developed one application using VB6/Access 2000 platform. In that, I have secured the database by using "Set Database Password...". I can open this Password protected database connection using following string.

.provider = "Microsoft.Jet.OLEDB.4.0;"
.open app.path & "\filenm.mdb"

Now my problem is when I run this application on MS Access 2003 XP Professional, it gives an error for "not valid password" & also gives an error for ".Provider". Actually ".provider" property doesn't support.

I will be very thankful if somebody can give the best solution.

Thanks in advance.
Question by:jitu_r_soni
    LVL 9

    Accepted Solution

    Are you able to connect thru ADODB Active X control?
    If so, try to Build COnnection string from there if it succeeded the test then copy the exact connection string from there to your project.

    Wish u all the best.
    N.Pradap Kumar
    LVL 11

    Expert Comment


    YourConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" app.path & "\filenm.mdb"
     & ";Jet OLEDB:Database Password=password;"
    LVL 11

    Assisted Solution

    Sorry, forgot an "&"

    YourConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & app.path & "\filenm.mdb"
     & ";Jet OLEDB:Database Password=password;"
    LVL 4

    Assisted Solution

    try this

    Public ACCDB As Database
    Public GLLCSYSDB As Database

     GL_pBDbs = "c:\" & "ACCOUNT.mdb"
         GL_pBDbs1 = "c:\" & "ACCOUNT.mdb"
       Set ACCDB = Workspaces(0).OpenDatabase(GL_pBDbs, False, False, ";pwd=ACC1999")
       Set GLLCSYSDB = Workspaces(0).OpenDatabase(GL_pBDbs1, False, False, ";pwd=ACC1999")

    i use it in my application
    LVL 11

    Expert Comment

    Here's an article that might be of interest to you:

    Could it be the version of MDAC that it was compiled with ?!?!?

    I know 2.6 and higher don't include the access odbc driver, but that doesn't seem to be the issue here.

    Going back to DAO definitely isn't the answer! ;)

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    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…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    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…

    730 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now