Microsoft KB Archive/236518

= MOD2000: Data Environment Designer Can't Refresh Parameters of Command Object =

Article ID: 236518

Article Last Modified on 7/31/2001

-

APPLIES TO


 * Microsoft Office 2000 Developer Edition

-



This article was previously published under Q236518



Advanced: Requires expert coding, interoperability, and multiuser skills.



SYMPTOMS
If you have a command object defined in a Data Environment that runs a stored procedure with parameters, any changes that you make directly to the parameter specifications in the SQL statement are not reflected in the command object.



CAUSE
Parameter definition changes are not updated automatically. Also, they are not refreshed when the command is refreshed.



RESOLUTION
To refresh the parameters in your connection object, follow these steps:
 * 1) Right-click the command, and then click Properties.
 * 2) In the Object Name list, reselect the stored procedure that has not been refreshed.
 * 3) Click Apply or OK.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
CAUTION: If you follow the steps in this example, you modify the sample Access project NorthwindCS.adp. You may want to back up the NorthwindCS.adp file and follow these steps on a copy of the project.

Steps to Reproduce Behavior
 On a computer with the following software installed

 Microsoft Office 2000 Developer Microsoft Data Engine (MSDE)

open the sample MSDE database NorthwindCS.adp. Under Objects, click Stored Procedures.</li> Click New, type the following in the new stored procedure box, and then save the stored procedure:

Create Procedure orders_list

@input_customerid VarChar(20)

As

Select * From Orders

Where CustomerID = @input_customerid

</li> On the Tools menu, point to Macro, and then click Visual Basic Editor.</li> In the Visual Basic Editor, click New Project on the File menu.</li> In the New Project box, click Empty Project, and then click OK.</li> On the Insert menu, click Components.</li> In the Components dialog box, click the Designers tab and make sure that the Data Environment check box is selected. Then, click OK.</li> Click Project1, and then on the Insert menu, click Data Environment.</li> Right-click Connection1, and then click Properties.</li> In the Data Link Properties box, click the Provider tab, click Microsoft OLE DB Provider for SQL Server, and then click Next.</li> On the Connection tab, fill in all the boxes. If you have the NorthwindCS.adp file installed with default security, use following entries:

Server name = (local)

User name = sa

Password =

Blank Password = checked

Database = NorthwindCS

</li> Click Test Connection, and then click OK to close the Data Link Properties dialog box.</li> Right-click Connection1, and then click Add Command.</li> Right-click Command1, and then click Properties.</li> In the Command1 Properties dialog box, click Stored Procedure in the Database Object list.</li> In the Object Name list, click the stored procedure that you created earlier. It should appear in the list as dbo.orders_list.</li> <li>Click OK to close the Command Properties dialog box.</li> <li>Right-click Command1, and then click Properties.</li> <li>In the Command1 Properties dialog box, click the Parameters tab, and in the Parameter list, click input_customerid. Note that the Size box setting is 20. Click OK.</li> <li>On the View menu, click Microsoft Access to return to Microsoft Access.</li> <li>In Access, click to select the orders_list stored procedure, and then click Design.</li> <li>Make the following changes to the stored procedure. Note that you are changing the size of the original parameter to 40 and that you are also adding an extra parameter called input_shipname.

Alter Procedure orders_list

@input_customerid VarChar(40),

@input_shipname VarChar(40)

As

Select * From Orders

Where CustomerID = @input_customerid

and ShipName = @input_shipname

</li> <li>Save and close the procedure.</li> <li>On the Tools menu, point to Macro, and then click Visual Basic Editor.</li> <li>Right-click Command1, and then click Refresh.</li> <li>Right-click Command1, and then click Properties.</li> <li>Click the Parameters tab.</li></ol>

Note that the size of the input_customerid parameter is still set to 20 and that the new input_shipname parameter is not listed at all.

Additional query words: pra can t cannot

Keywords: kbbug kbnofix kbdesigner KB236518

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.