| | |
Data Environment plus SQL Parameter in VB
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hi,
Try This :
Open a Data Project
Add a Connection Object (Configure to your database)
Add A Command Object (Say Command1) And Right-Click
Goto properties and Select Option SQL Statement and Type :
Select * From MyTable Where MyDate Between ? And ?
Click on Apply,
Parameter Tab Is Enabled, Go there..
Set these properties for both Parameters:
DataType = adDBDate
HostDataType =Date (VT_Date)
And Apply,
Save the Project
Now Design the DataReport1 on this Command Object...
In The Calling Form, Place 2 Date Pickers say DTFr and DTTo
Place Command Button And Show the Report like this :
Regards
Veena
Try This :
Open a Data Project
Add a Connection Object (Configure to your database)
Add A Command Object (Say Command1) And Right-Click
Goto properties and Select Option SQL Statement and Type :
Select * From MyTable Where MyDate Between ? And ?
Click on Apply,
Parameter Tab Is Enabled, Go there..
Set these properties for both Parameters:
DataType = adDBDate
HostDataType =Date (VT_Date)
And Apply,
Save the Project
Now Design the DataReport1 on this Command Object...
In The Calling Form, Place 2 Date Pickers say DTFr and DTTo
Place Command Button And Show the Report like this :
vb Syntax (Toggle Plain Text)
Load DataEnvironment1 With DataEnvironment1 If .rsCommand1.State <> 0 Then .rsCommand1.Close .Command1 Format(DTFr.Value,"dd-mm-yyyy"), Format(DTTo.Value,"dd-mm-yyyy") End With DataReport1.Show
Regards
Veena
![]() |
Similar Threads
- Passing Parameter in Data Reports (Visual Basic 4 / 5 / 6)
- How to configure GD (PHP)
- How to Use an Input parameter in Stored Procedure with Datasets (C#)
- DAta environment (Visual Basic 4 / 5 / 6)
- Connecting to a SQL Server Database using VB (VB.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Encrypting a .txt file through VB6
- Next Thread: Match String and extract till EndOfLine
Views: 1415 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 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 remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





