Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized query using ADO and VB6.0
Message
From
28/12/1998 06:30:51
 
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Parameterized query using ADO and VB6.0
Miscellaneous
Thread ID:
00170691
Message ID:
00170691
Views:
132
We made a Parameterized Sql command (command1) in dataenvironment with the
following SQL statment:
SELECT * FROM Table Where COD_PROD = ?

We use this Command object in many bound controls into our form. When we run
the form, the Initialize event do:
Environment.Command1("01") && define the initial parameter value like
"01"

It's works well, but now a want to change the parameter to "02". For this,
in a commandbutton.click we use the following code:

Environment.rsCommand1.Close && we close the recodset
Environment.Command1("02") && change whe parameter to "02"

At this point, we can see from DEBUG that the recodset object was changed.
After access the SQL server the recordset have the new resultsets (now with
COD_PROD = "02").
BUT THE PROBLEM IS....

all bound controls doesn´t work....
the DBGrid is showing the old resultsets (COD_PROD = "01"), all my textboxes
too.
To change it we run :
Grid.SourceName = Grid.SourceName
So the grid works (showing the new resultset -> COD_Prod = "02"), but the
all bound controls doesn´t.
We try to use Requery command in recordset, but it´s result in a error
message...

After the command "Environment.Command1("02")" all bound controls doesn´t
work any more....

How can we resolve this problem?
Next
Reply
Map
View

Click here to load this message in the networking platform