I am loading a crystal report via VB6 and the report is going to show mobile phone numbers and ICCID numbers, Using the following code I can get the report to show the first 1000 mobile numbers. But if I want to get the report to show a different range of numbers it just brings back the same set of 1000 numbers
I am using two sql statements (one for "All" mobile numbers to be shown with a specific ID and one for a range of numbers, from A to B)VB Code:
Private Sub Form_Load() Dim Appl As New CRAXDRT.Application Dim Report As New CRAXDRT.Report Dim Rs As ADODB.Recordset Dim Conn As Connection Dim strSQL As String Set Conn = New Connection With Conn 'Set up an ODBC connection to Cerillion to the database defined in SystemDSN .ConnectionString = "Provider=OraOLEDB.Oracle;User Id=Super;Password=Password;Data Source=" & ServerName & ";" 'Open the ODBC connection .Open End With If frmJTPrint.optAll = True Then strSQL = "select Access_NO,ICCID from Test_Dec_Puk_Details tdPD, Test_Dec_GSM_PP_Access_Numbers tdGPAN where tdPD.ICCID = Ltrim(tdGPAN.Assoc_Access_No) and ICCID_Full = '" & FileIDToPrint & "'" ElseIf frmJTPrint.optPhoneNumberRange = True Then strSQL = "select Access_NO,ICCID from Test_Dec_Puk_Details tdPD, Test_Dec_GSM_PP_Access_Numbers tdGPAN where tdPD.ICCID = Ltrim(tdGPAN.Assoc_Access_No) and ICCID_Full = '" & FileIDToPrint & "' and Access_NO >= '" & tempFrom & "' and Access_NO <= '" & tempTo & "'" End If Set Rs = New ADODB.Recordset Set Rs = Conn.Execute(strSQL) Set Appl = New CRAXDRT.Application Set Report = Appl.OpenReport(App.Path & "\Labels.rpt", 1) Report.Database.SetDataSource Rs, 3, 1 CRView.Refresh CRView.ReportSource = Report CRView.ViewReport End Sub
These dont seem to be working, any help would be appreciated
Thanks




Reply With Quote