Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread DataSet Manager > RowSource > Query issue
Thu, Dec 17 2015 5:47 PMPermanent Link

Trinione

I searched thru the forum and am not seeing anything on this issue, so hope I am not reposting a matter previously addressed.

The instruction says that to set the Parameter, 'Use {ParameterName = DefaultValue } ... (DefautValue is optional)'

I would think if the DefaultValue is optional there would be no need to set it. Am I misunderstanding this?

Example #1: However, the following does not work:
SELECT password FROM Users
WHERE userID = {userID}

Example #2: Whereas, the following does:
SELECT password FROM Users
WHERE userID = {userID = 0}

The thing is, Example #1 would not return an error on saving, however dragging and dropping the DataSet on a form returns an error and the dataset object is empty. To get it to work I need to set a 'dummy' value as in Example #2.

The error displayed is:
ElevateDB Error #700 An error was found in the statement at line 2 and column XX (Expected  expression but instead found {)
Fri, Dec 18 2015 9:35 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< The thing is, Example #1 would not return an error on saving, however dragging and dropping the DataSet on a form returns an error and the dataset object is empty. To get it to work I need to set a 'dummy' value as in Example #2. >>

That's basically the entire purpose of the default value: to provide a value to be used for the dataset parameter at design-time.  Most of the time you should just set it to a value that won't return any rows, unless you actually want a default value.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Dec 18 2015 10:33 AMPermanent Link

Trinione

Tim:
<< That's basically the entire purpose of the default value: to provide a value to be used for the dataset parameter at design-time.  Most of the time you should just set it to a value that won't return any rows, unless you actually want a default value. >>

Ok. It's the  (DefautValue is optional)' that had me thinking I could write 'userID = {userID}'.

Thanks.
Fri, Dec 18 2015 5:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< Ok. It's the  (DefautValue is optional)' that had me thinking I could write 'userID = {userID}'. >>

You *can*.  Just don't try to do something with the dataset at design-time after that point and expect it to work. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Sat, Dec 19 2015 11:33 AMPermanent Link

Trinione

Hahahahahahaha
Image