|
-
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
-
Mar 7th, 2006, 01:03 AM
#2
Frenzied Member
Re: Problem in Reporting
App.Path returns the directory address where your application is located. place AttSys.mdb in the directory where you saved your project. then recreate your setup installer or deployment pachage and this time, include the AttSys.mdb in your setup. then reinstall your prog. setup will then place AttSys.mdb in the folder where your application is installed.
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 7th, 2006, 01:07 AM
#3
Thread Starter
Fanatic Member
Re: Problem in Reporting
Thanks,
I did this. but no avail
facing same error
-
Mar 7th, 2006, 01:09 AM
#4
Frenzied Member
Re: Problem in Reporting
is the database where it is supposed to be - F:\AttSys\AttSys.Mdb
-
Mar 7th, 2006, 01:11 AM
#5
Thread Starter
Fanatic Member
Re: Problem in Reporting
Yes and this is the path where my project files exist.
-
Mar 7th, 2006, 01:14 AM
#6
Frenzied Member
Re: Problem in Reporting
your code seemed fine to me. what was the error message you get?
By the way, i didn't see any AttSys.mdb being used in your code. the mdb file you used is attdb.mdb, are they the same or do you mean it to be the same
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 7th, 2006, 01:17 AM
#7
Thread Starter
Fanatic Member
Re: Problem in Reporting
yes my file name is ATTDB.MDB
-
Mar 7th, 2006, 01:21 AM
#8
Re: Problem in Reporting
 Originally Posted by hafizfarooq
yes my file name is ATTDB.MDB
Where is your attdb.mdb located?
-
Mar 7th, 2006, 01:21 AM
#9
Frenzied Member
Re: Problem in Reporting
this is getting a bit confusing for me.
u're crystal reports looks for attsys.mdb and u're recordset works with attdb.mdb.
what u can do is check for any piece of code that is looking for attsys.mdb and change it to attdb.mdb and do a check on the report
-
Mar 7th, 2006, 01:21 AM
#10
Thread Starter
Fanatic Member
Re: Problem in Reporting
Following error i m facing
ERROR IN OPENING FILE.
FILE COULD NOT BE FOUND "TBL_EMP_AAT" AT FILE LOCATION "TBL_EMP_ATT"
-
Mar 7th, 2006, 01:22 AM
#11
Frenzied Member
Re: Problem in Reporting
if attdb is your main database, whats the purpose of the AttSys.mdb. is it a temporary database or what?
please dont be offended, I'm just bothered by its usage
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 7th, 2006, 01:24 AM
#12
Thread Starter
Fanatic Member
Re: Problem in Reporting
Sorry. I Was Wrong. Its Attdb.mdb Not Attsys.mdb
-
Mar 7th, 2006, 01:27 AM
#13
Frenzied Member
Re: Problem in Reporting
so you dont have the AttSys.mdb instead, it is AttDb.mdb
try to go over your code and check if theres something that is refering to AttSys.mdb
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 7th, 2006, 01:28 AM
#14
Thread Starter
Fanatic Member
Re: Problem in Reporting
I Have Checked It, Theres Nothing Like Attsys.mdb
-
Mar 7th, 2006, 01:55 AM
#15
Frenzied Member
Re: Problem in Reporting
have you tried to include ATTDB.mdb in your deployment setup?
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 7th, 2006, 07:49 AM
#16
Re: Problem in Reporting
Moved to reporting section.
-
Mar 7th, 2006, 12:40 PM
#17
Thread Starter
Fanatic Member
Re: Problem in Reporting
I have addedd AttDb.Mdb in my deployment setup too
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
|