Results 1 to 17 of 17

Thread: Problem in Reporting

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    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

  2. #2
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    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

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Problem in Reporting

    Thanks,
    I did this. but no avail
    facing same error

  4. #4
    Frenzied Member
    Join Date
    May 2003
    Location
    Sydney
    Posts
    1,123

    Re: Problem in Reporting

    is the database where it is supposed to be - F:\AttSys\AttSys.Mdb

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Problem in Reporting

    Yes and this is the path where my project files exist.

  6. #6
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    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

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Problem in Reporting

    yes my file name is ATTDB.MDB

  8. #8
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Problem in Reporting

    Quote Originally Posted by hafizfarooq
    yes my file name is ATTDB.MDB
    Where is your attdb.mdb located?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  9. #9
    Frenzied Member
    Join Date
    May 2003
    Location
    Sydney
    Posts
    1,123

    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

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    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"

  11. #11
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    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

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Problem in Reporting

    Sorry. I Was Wrong. Its Attdb.mdb Not Attsys.mdb

  13. #13
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    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

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Problem in Reporting

    I Have Checked It, Theres Nothing Like Attsys.mdb

  15. #15
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    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

  16. #16
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Problem in Reporting

    Moved to reporting section.

  17. #17

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    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
  •  



Click Here to Expand Forum to Full Width