Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Datareport using dataenvironment 1

Status
Not open for further replies.

giyer555

Programmer
Sep 8, 2003
75
IN
I am using datareports in VB 6 & the datasource is through dataenvironment.

Using command button in a form the user retrieves data through datareport.
My problem is I need to refresh the datareport without closing the application.

For eg: the command button retrieve has the foll code
dim ssql as string
ssql = "select a,b,c,d,e,f from xyz where a = '" & txtpqr.txt & "'
de1.commands(4).commandtext = ssql
datareport.show

Can anyone tell me how do i refresh the datareport everytime the use clicks the command button.
 
You need to close and open the data environment connection, something like....

Code:
With DE1.Conn1
      If .State = adStateOpen Then .Close
        .ConnectionString = "Provider=MSDataShape.1;Persist Security Info=False;Data Source=" & _
        DbaseName & ";Data Provider=MICROSOFT.JET.OLEDB.4.0"
        .Open
    End With


Pete Vickerstaff - Hedra Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top