Results 1 to 2 of 2

Thread: problem with query result on crystal report

  1. #1

    Thread Starter
    Hyperactive Member wizkid's Avatar
    Join Date
    Dec 2005
    Location
    uk
    Posts
    405

    problem with query result on crystal report

    hi,
    i am facing some problem with crystal report.
    i am using vb6 and crystal 9

    "SELECT PRODUCT.STYLE_CODE FROM PRODUCT ,SALES_ITEM Where (PRODUCT.PRODUCT_CODE = SALES_ITEM.PRODUCT_CODE) AND (SUBSTR(PRODUCT.STYLE_CODE,1,2)='MT' OR SUBSTR(PRODUCT.STYLE_CODE,1,2)='MX') AND SALES_ITEM.ORDER_TYPE=0 AND order_date>(new_time('31-aug-2005','GMT','GMT') - to_date('01-jan-1970','dd-mon-yyyy')) * (24*60*60) group BY PRODUCT.STYLE_CODE"


    this query working fine in oracle database and in vb project also i am getting result for this query.

    But i am not getting any result on report.I don't know what's the problem is.
    as u people said , i change the cursor .CursorLocation = adUseClient.
    but no use.same blank report.
    Please give me some suggestion!!!


    visual basic code
    VB Code:
    1. Private Sub Command3_Click()
    2. Dim db_conn As New ADODB.Connection
    3. Dim rs As ADODB.Recordset
    4. Dim CRReport As CRAXDRT.report
    5. Dim CrApp As New CRAXDRT.Application
    6.    
    7. 'Open the Crystal Report
    8.  Set CRReport = CrApp.OpenReport("C:\Program Files\Microsoft Visual Studio\VB98\AlterationReport\Report2.rpt")
    9.  Set rs = New ADODB.Recordset
    10.    
    11.     db_conn.Open "Driver={Microsoft ODBC for Oracle};" & _
    12.     "Server=test;" & _
    13.     "Uid=scott;" & _
    14.     "Pwd=tiger"
    15.     Dim sqlq As String
    16.  db_conn.CursorLocation = adUseClient
    17.  
    18.  sqlq = "SELECT PRODUCT.STYLE_CODE FROM PRODUCT,SALES_ITEM Where (PRODUCT.PRODUCT_CODE = SALES_ITEM.PRODUCT_CODE) AND (SUBSTR(PRODUCT.STYLE_CODE,1,2)='MT' OR SUBSTR(PRODUCT.STYLE_CODE,1,2)='MX') AND SALES_ITEM.ORDER_TYPE=0 AND order_date>(new_time('31-aug-2005','GMT','GMT') - to_date('01-jan-1970','dd-mon-yyyy')) * (24*60*60) group BY PRODUCT.STYLE_CODE"
    19.  
    20.     With CRReport
    21.         'Set the Access database path
    22.         .Database.Tables(1).Location = App.Path & "\MData"
    23.         With rs
    24.             .ActiveConnection = db_conn
    25.             .CursorLocation = adUseClient
    26.             .CursorType = adOpenStatic
    27.             .LockType = adLockOptimistic
    28.             .Open sqlq
    29.         End With
    30.          MsgBox rs(0)
    31.         .Database.SetDataSource rs, 3, 1
    32.         CRViewer91.ReportSource = CRReport
    33.        CRViewer91.ViewReport
    34.     End With
    35.  
    36. End Sub
    please help me
    thanks wizkid

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

    Re: problem with query result on crystal report

    Moved to reporting section

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