Results 1 to 2 of 2

Thread: my crystal report database can't change

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    3

    my crystal report database can't change

    dear all

    i have the form to call my report like this
    -----------------------------------------------
    Dim Report As New crParticipantPersonalData, _
    CRXParamDefs As CRAXDRT.ParameterFieldDefinitions, _
    CRXParamDef As CRAXDRT.ParameterFieldDefinition

    Screen.MousePointer = vbHourglass
    Set CRXParamDefs = Report.ParameterFields

    If dtcTopic.Text = "" Then dtcTopic.BoundText = ""
    If dtcCategory.Text = "" Then dtcCategory.BoundText = ""
    If dtcSubCat.Text = "" Then dtcSubCat.BoundText = ""
    If dtcSpecialty.Text = "" Then dtcSpecialty.BoundText = ""

    'This code cycles through the ParameterFieldDefinitions collection in the main report.
    For Each CRXParamDef In CRXParamDefs
    With CRXParamDef
    Select Case .ParameterFieldName
    Case "@begindate": .SetCurrentValue dtpBegin.Value
    Case "@enddate": .SetCurrentValue dtpEnd.Value
    End Select
    End With
    Next
    Adodc1.ConnectionString = db1
    Adodc1.RecordSource = "exec sp_Rpt_Par_Personal_Data"
    Adodc1.Refresh

    Report.Database.SetDataSource Adodc1
    Report.txtSeminarDate.SetText "Seminar Date : from " & Format(dtpBegin.Value, "dd MMM yyyy") & " to " & Format(dtpEnd.Value, "dd MMM yyyy")

    'Finally, it disables parameter prompting so the user won’t be prompted for a value.
    Report.EnableParameterPrompting = False
    CRViewer1.ReportSource = Report
    CRViewer1.ViewReport
    Screen.MousePointer = vbDefault

    note : default value of db1 is Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="DSN=academy1;UID=;APP=Visual Basic;WSID=KAWI;DATABASE=LMC1;Trusted_Connection=Yes"

    ---------------------------------------------------------------------

    i have changed the value of db1 into Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="DSN=academy;UID=;APP=Visual Basic;WSID=KAWI;DATABASE=LMC;Trusted_Connection=Yes"

    but when the report is open,the value of the report is still using the 1st one.anyone can help me to out of this problem..thanks alot

    regards

    martell

  2. #2
    Addicted Member mabbas110's Avatar
    Join Date
    Oct 2005
    Location
    Karachi , Pakistan
    Posts
    172

    Re: my crystal report database can't change

    Dear u have to do one thing , that go to database expert , it will be displaying old database name , just select the new database name from the below box and click update and then run it from report , hopefully ur problem will be resolved.
    Thanks and Regards,

    Muhammad Abbas

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