| | |
Recordset is not effecting my report? Help
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hello,
I am using VB6.0 and crystal report8.5. my problem is that my report is not behaving dynamically. Iam using MS-ACCESS database.
Some of my may help you figure out.
Here in my application when i launch report all the records all displayed
I want to have records where age>23
Help me this is my first commercial project
I am using VB6.0 and crystal report8.5. my problem is that my report is not behaving dynamically. Iam using MS-ACCESS database.
Some of my may help you figure out.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim conn As ADODB.Connection 'CONNECTION TO BROKER QUERIES Dim rs As ADODB.Recordset 'HOLDS ALL DATA RETURNED FROM QUERY Dim crystal As CRAXDRT.Application 'LOADS REPORT FROM FILE Dim report As CRAXDRT.report 'HOLDS REPORT CRViewer.DisplayBorder = False 'MAKES REPORT FILL ENTIRE FORM CRViewer.DisplayTabs = False 'THIS REPORT DOES NOT DRILL DOWN, NOT NEEDED CRViewer.EnableDrillDown = False 'REPORT DOES NOT SUPPORT DRILL-DOWN CRViewer.EnableRefreshButton = False 'ADO RECORDSET WILL NOT CHANGE, NOT NEEDED Set conn = New ADODB.Connection 'Assuming that connection is established conn.Open 'THESE OPTION VALUES ARE BEST FOR VB Set rs = New ADODB.Recordset rs.Open "SELECT * FROM report", conn, adOpenStatic, adLockReadOnly Set crystal = New CRAXDRT.Application 'MANAGES REPORTS Set report = crystal.OpenReport(App.Path & "report1.rpt") 'OPEN OUR REPORT report.DiscardSavedData 'CLEARS REPORT SO WE WORK FROM RECORDSET report.Database.SetDataSource rs 'LINK REPORT TO RECORDSET CRViewer.ReportSource = report 'LINK VIEWER TO REPORT CRViewer.ViewReport 'SHOW REPORT Do While CRViewer.IsBusy 'ZOOM METHOD DOES NOT WORK WHILE DoEvents 'REPORT IS LOADING, SO WE MUST PAUSE Loop 'WHILE REPORT LOADS. CRViewer.Zoom 94 rs.Close 'ALL BELOW HERE IS CLEANUP Set rs = Nothing conn.Close Set conn = Nothing Set crystal = Nothing Set report = Nothing End Sub Private Sub Form_Resize() 'MAKE SURE REPORT FILLS FORM CRViewer.Top = 0 'WHEN FORM IS RESIZED CRViewer.Left = 0 CRViewer.Height = ScaleHeight CRViewer.Width = ScaleWidth 'End of Code
Here in my application when i launch report all the records all displayed
I want to have records where age>23
Help me this is my first commercial project
Last edited by Comatose; Apr 7th, 2006 at 6:33 pm. Reason: Code Tags
use
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
rs.Open "SELECT * FROM report where age > 23", conn, adOpenStatic, adLockReadOnly
![]() |
Similar Threads
- Data Report in vb 6.0 (Visual Basic 4 / 5 / 6)
- about data report (Visual Basic 4 / 5 / 6)
- VB Report (Visual Basic 4 / 5 / 6)
- Vb report generation (Visual Basic 4 / 5 / 6)
- "ADODB Recordset error" (ASP)
- Doublechecking that THIS is a healthy HJT report... (Viruses, Spyware and other Nasties)
- Review Upgrade Report (Windows tips 'n' tweaks)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB share where project
- Next Thread: log file
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





