|
-
Mar 7th, 2006, 12:53 AM
#1
Thread Starter
Fanatic Member
Problem in Reporting
I hvae developed a project for staff attendance with VB and Access using ADO Library
I used Crystal Report 8 for reporting.
When I was creating reports the database path was F:\AttSys\AttSys.Mdb
I have run that project in VB so many times and it run well.
I developed SETUP for that project and install that setup on the other PC where F:\AttSys\AttSys.Mdb
was not available
After installing that project it run well but whrn try to open thew reports they give the error
which shows that database path is not correct. Its trying to get F:\AttSys\AttSys.Mdb which is not available.
How to solve this problem.
How to change the database path using code as to set the path on App.Path
Please help me.
I m using the follwong Code to show report
Dim Report As New CrDailyRep
Dim Db As New ADODB.Connection
Dim Rs As New ADODB.Recordset
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
Screen.MousePointer = vbDefault
Call ViewRep
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Public Sub ViewRep()
Set Db = New ADODB.Connection
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\attdb.mdb;Mode=Read"
Set Rs = New ADODB.Recordset
With Rs
.Open "Select * from Tbl_Emp_Att", Db, adOpenDynamic, adLockOptimistic
On Error Resume Next
Report.Text2.SetText "REPORT OF " & FrmDaily.TxtDate.Text
StrSel = "{Tbl_Emp_Att.Att_Date} in Date(" & _
Format(FrmDaily.TxtDate, "yyyy,m,d") & ") to Date(" & _
Format(FrmDaily.TxtDate, "yyyy,m,d") & ")"
Report.DiscardSavedData
Report.Database.SetDataSource Rs
Report.RecordSelectionFormula = StrSel
CRViewer1.ReportSource = Report
CRViewer1.EnableRefreshButton = True
CRViewer1.ViewReport
End With
End Sub
Please help me
Farooq
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|