vb6 - How to pass value to SQL Query in Data Environment's Command Object at run-time in Visual Basic 6.0? -


in dataenvironment have command object in have given following sql query:

select * userdetails date = todays_date 

here todays_date public variable in module. variable accepts value @ run-time.

how call variable in dataenvironment's sql query?

the vb6 manuals cover in closing , reopening recordset under heading data environment programming guidelines. example given there looks like:

option explicit  private sub command1_click()     ' must close recordset before changing parameter.     if dataenvironment1.rscommandquery.state = adstateopen         dataenvironment1.rscommandquery.close     end if     ' reopen recordset input parameter supplied     ' textbox control.     dataenvironment1.commandquery text1.text     text2         .datafield = "au_lname"         .datamember = "commandquery"         set .datasource = dataenvironment1     end end sub  private sub form_load()     ' supply default value.     text1.text = "172-32-1172"     ' change commandbutton caption.     command1.caption = "run query" end sub 

you call command object method of parent dataenvironment, passing parameters there. gotta love fine manual.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -