Results 1 to 3 of 3

Thread: CR9 VB6 and passwords

  1. #1

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    CR9 VB6 and passwords

    I have the follwoing code in my VB app...

    For Each crxDatabaseTable In Report.Database.Tables
    crxDatabaseTable.SetDataSource ("C:\Techni.mdb")
    crxDatabaseTable.ConnectionProperties("Password") = "fred"
    Next crxDatabaseTable

    It works just fine. I use it for every report that I run from within my app. However, I have one small problem. A lot of times, a user will come back and tell me that there is a problem. So, I step through the code trying to find the error. The user, looking over my shoulder can see the db password in the source code.

    How can I just reference a variable in the report connection property? Or can I set up a global subroutine and call that? I don't want all my users knowing the db password.

  2. #2
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381
    I would do it this way.

    VB Code:
    1. 'Under Sub Main() Declaration
    2. Public myPASSWORD as String
    3.  
    4. 'Under SubMain
    5. myPASSWORD = "fred"
    6.  
    7. 'On the report form
    8. crxDatabaseTable.ConnectionProperties("Password") = myPASSWORD

  3. #3

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    That worked. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width