What do you think is wrong in my code?

I have this error, see the pic below.
Name:  error.JPG
Views: 446
Size:  20.1 KB

Code:
 Set rs = New ADODB.Recordset
      rs.CursorLocation = adUseClient
      strsql = "SELECT * FROM view_FGSUB WHERE REFDATE >= '" & DTPicker6.Value & "' AND REFDATE <= '" & DTPicker10.Value & "' AND ITEMCODE='" & NSDataCombo1.Text & "' "
      rs.Open strsql, cn, adOpenForwardOnly, adLockOptimistic

    Dim dt1 As Date
    Dim dt2 As Date

    dt1 = DTPicker6.Value
    dt2 = DTPicker10.Value
    With CrystalReport1
        .Reset
        .Connect = "con"
        .ReportFileName = App.Path & "\Reports\stockledger2.rpt"
        .LogOnServer "pdsodbc.dll", "Troprpt2", db2, username2, password2
        .RetrieveDataFiles
        .WindowShowCloseBtn = True
        .WindowShowExportBtn = True
        .WindowShowRefreshBtn = True
        .WindowShowPrintBtn = True
        .WindowShowPrintSetupBtn = True
        .WindowState = crptMaximized
        


        .SelectionFormula = "{view_FGSUB.REFDATE} >= '" & dt1 & "' AND {view_FGSUB.REFDATE} <= '" & dt2 & "' AND {view_FGSUB.ITEMCODE} = '" & NSDataCombo1.Text & "' "
        .action = 1
           

    End With
And I created a parameters in my CR.
Name:  1.jpg
Views: 410
Size:  30.7 KB

My report is connected to VIEW_FGSUB

I used stored proc before but I have an error "the database file has changed. proceeding to fix up the report"
and I loads very slow
but it generate the report that I am looking for.


I'm kinda confused right now.