Results 1 to 2 of 2

Thread: Password Protected Access 2000 & Crystal Report

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Posts
    17

    Exclamation Password Protected Access 2000 & Crystal Report

    Hi!
    Please help on the following issue :
    I've a password protected access 2000 database.
    I want to connect to a report already prepared in crystal report 8.5 where the parameter would go from my form.
    For eg. if i'm supplying a specific EMP ID, the vb application will do all the caslculations and will send to a specific table and the job of the crystal report is to show that report but i want the report to show the name of the employee and other details in the report which are not present in the table and i've to collect from my vb application.
    I know i can use formula but the mail problem is i can't connect the password protected database.
    Again i would like to know how can i use DSN so that where ever my application is loaded any m/c from LAN can locate my report.
    I'm pasting a piece of code which i used previously :

    'ct1 is the crystal report ocx
    ct1.ReportFileName = "D:\I B A\rpt_genealogy.rpt"
    'ct1.SelectionFormula = "{DISTRIBUTOR_DETAIL_TABLE.DISB_ID} = " & "'" & d & "'"
    ct1.Formulas(0) = "f1= " & "'" & UCase(CStr(rs1!Name)) & " Associate Id : " & Text3 & "'"
    ct1.DataFiles(0) = "D:\I B A\BUSINESS_SYSTEM.mdb"
    ct1.WindowParentHandle = frmgenelogy.hWnd
    ct1.Action = 0
    ct1.DiscardSavedData = True
    ct1.Destination = crptToWindow
    but this time the database was not password protected and now the connection string looks like the following which i think will give you the idea what i'm after :
    'connect_string is global variable and the following piece of code is in the sub main of my application
    ' con is the adodb connection

    Connect_String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & app.path & "\MLM SYSTEM\mlmdatabase.mdb;Persist Security Info=False;Jet OLEDBatabase Password=PASSWORD123"
    Con.ConnectionString = Connect_String
    Con.Open

  2. #2
    Hyperactive Member
    Join Date
    Mar 2005
    Location
    Manila, Philippines
    Posts
    486

    Re: Password Protected Access 2000 & Crystal Report

    VB Code:
    1. ct1.connect="Acces 2000;pwd=yourpassword"
    2. ct1.DataFiles(0) = "D:\I B A\BUSINESS_SYSTEM.mdb"
    3. ct1.ReportFileName = "D:\I B A\rpt_genealogy.rpt"
    4. 'ct1.SelectionFormula = "{DISTRIBUTOR_DETAIL_TABLE.DISB_ID} = " & "'" & d & "'"
    5. ct1.Formulas(0) = "f1= " & "'" & UCase(CStr(rs1!Name)) & " Associate Id : " & Text3 & "'"
    6. ct1.WindowParentHandle = frmgenelogy.hWnd
    7. ct1.Action = 0
    8. ct1.DiscardSavedData = True
    9. ct1.Destination = crptToWindow

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