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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command object parameters

Status
Not open for further replies.

TerryAtFlex

Programmer
Feb 11, 2004
3
US
I am using CR9 with MSSQL2000. I want to use a command object, and I want to add parameters to it. My query looks like this:

Select Count(*) From Broker Where Broker.State = [{prmState}]

prmState is the parameter I want to supply at runtime. The documentation is very sparse on the subject. Can anyone help me to use the Modify Command window?

Thanks

Terry At Flex
 
I don't have 9.0, but I'm pretty sure that your statement should look like this:

Select MyCount = Count(*) From Broker Where Broker.State = {?prmState}

-dave
 
Almost works.

Now my query is as below:

Select Count(*) From Broker Where Broker.State = {?prmState}

I add a parameter to the right named prmState of type string, give it a default value of MI, and when I press the OK I get the Enter Parameter Values dialogue. When I press OK on this window, I get an error, Failed to open a rowset.
Source: MS OLE DB Provider for SQL Server
The description: Invalid Column Name 'MI'

Any ideas?

Thanks, btw, for your reply!

Terry
 
Select Count(*) From Broker Where Broker.State = '{?prmState}'

did the trick!!

Thanks for pointing me in the right direction. This is a big deal for me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top