Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 Oracle
Hello all
I m working in vb6 n oracle n now preparing report using crystal report 8.5.
 
I designed report n add oracle tables with their links n it's working well......
 
Now I wanna add record-set of sql queries to display report as per user demands but how to n
 
where to write sql commands in crystal report n how can I execute them???
 
I'm totally blank plz help me.......
 
ex.

SQL = "SELECT A.*,C.*,B.LOC_NAME FROM ASSET_OPTION A,LOCATION B,ASSET C WHERE "
SQL = SQL + " C.LOC_ID=B.LOC_ID AND C.AID=A.AID AND ASSET_NAME LIKE " & "'%" & UCase(STR) & "%' AND BIT='FALSE'"
RS.Open SQL, CON, 1, 2
Posted 20-Mar-13 21:22pm
surkhi623

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please refer to this Tutorial[^] for creating crystal reports using oracle.Here is the link for using crstal reports with VB6. Read these links and come with real coding issues.
 
Cheers,
Sudhakar
  Permalink  
Comments
cool_sari at 22-Mar-13 4:05am
   
My code doesn't working properly.......

Private Sub Command1_Click()
Dim STR As String
STR = Search1
SQL = "SELECT ASSET.AID,ASSET.ASSET_NAME,ASSET_OPTION.IDLE_SINCE_DATE,ASSET_OPTION.REASON_IDLE,ASSET_OPTION.UTILIZED_PERIOD,ASSET_OPTION.FREE_ON_DATE,ASSET_OPTION.CURRENT_STATUS,LOCATION.LOC_NAME "
SQL = SQL + " From ASSET,ASSET_OPTION,LOCATION "
SQL = SQL + " Where ASSET.AID = ASSET_OPTION.AID AND "
SQL = SQL + " ASSET_OPTION.LOC_ID = LOCATION.LOC_ID AND CURRENT_STATUS='USABLE' AND " & STR & ""
 
Report.Database.Tables(1).SetDataSource RS
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
End Sub
 

Private Function Search1() As String
Dim NM, STR1 As String
If Combo2.Text = "ALL ITEMS" Then
NM = NM & STR1 & " ASSET_NAME IS NOT NULL ": STR1 = " AND "
Else
If Combo2.Text <> Empty Then NM = NM & STR1 & "ASSET_NAME='" & Combo2.Text & "'": STR1 = " AND "
End If
 
If Combo1.Text = "ALL LOCATIONS" Then
NM = NM & STR1 & " LOC_NAME IS NOT NULL ": STR1 = " AND "
Else
If Combo1.Text <> Empty Then NM = NM & STR1 & "LOC_NAME='" & Combo1.Text & "'": STR1 = " AND "
End If
Search1 = NM
End Function

plz help
Sudhakar Shinde at 22-Mar-13 5:13am
   
What do you mean by does not work properly. Are you getting any error? Or you are not getting desired result?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100