borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (How to view the Date Format like DD/MM/YYYY in MSHFlexGrid)Next Topic (MS Access Capacity) New Topic New Poll Post Reply
AndreaVB Forum : Database : how to open CRYSTAL REPORT if database have password?
Poster Message
ashiyr
Level: Protégé

Registered: 05-04-2007
Posts: 5

icon how to open CRYSTAL REPORT if database have password?

i just want to know how to open crystal report if msaccess database have password? in my form i use Crviewer.
kindly help.

Private Sub Form_Initialize()

Call OpenCrystalReport

End Sub



Private Sub OpenCrystalReport()
    
    Dim CRReport2 As CRAXDRT.Report
    Dim CRApp2 As New CRAXDRT.Application
  
    Set CRReport2 = CRApp2.OpenReport(App.Path & "\Attendance.rpt")
    
    With CRReport2
        'Set the Access database path
        .Database.Tables(1).Location = App.Path & "\Mygradingsys.mdb"

    End With

    With CRViewAtt
        .ReportSource = CRReport2
        .ViewReport
        While .IsBusy
            DoEvents
        Wend
        .Visible = False
        .Refresh
    End With
    
    
    Set CRApp2 = Nothing
    Set CRReport2 = Nothing

End Sub

13-04-2007 at 01:31 PM
View Profile Send Email to User Show All Posts | Quote Reply
mikefox
Level: Trainee

Registered: 26-04-2007
Posts: 2
icon Re: how to open CRYSTAL REPORT if database have password?

I uses crystal for my reports, but i don't actually get the data needed to the backend dabase... try making a temporary database (mdb) for that matter... when you execute query save the data to the temporary database....

Dim mytable As New ADODB.Recordset
temp As New ADODB.Connection

mytable.open "select * from [tablename] where [field] = [expression]" [connection],  adOpenStatic, adLockReadOnly
if mytable.recordcount <> 0 then
         do until mytable.eof
             'execute query here....
         Temp.execute "INSERT INTO [tablename] (field1, field2, field3) values ([FieldFrom myTable])
              

         mytable.movenext
         loop
endif
table.close
set table = nothing


Hope this help.....

26-04-2007 at 01:46 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : how to open CRYSTAL REPORT if database have password?
Previous Topic (How to view the Date Format like DD/MM/YYYY in MSHFlexGrid)Next Topic (MS Access Capacity) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder