Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem Parameterizing SelectCmd in CursorAdapter
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Problem Parameterizing SelectCmd in CursorAdapter
Miscellaneous
Thread ID:
00925805
Message ID:
00925805
Views:
58
Hi,

I am having a problem trying to use a parameter in a CursorAdapter against a SQL Server 2000 database and I'm begging for help.

If I run the following code, my cursor is created.
BTW, the Carriage Returns in the code are only for easier viewing

text to This.SelectCmd noshow
select distinct ifs_table_clrled.transaction_id,
ifs_table_clrled.bank_account_code,
ifs_table_clrled.agency,
ifs_table_clrled.ref_trans_id,
ifs_table_clrled.ref_trans_line,
ifs_table_clrled.vendor_code,
ifs_table_clrled.vendor_name
from ifs_table_clrled where
RTRIM(ifs_table_clrled.transaction_id) in
('AD00001494825','AD00001495243','AD00001495343','AD00001495351','AD00001495357','AD00001495363')
and ifs_table_clrled.fisc_year = '2004'
endtext

If I run the following code using a parameter for the transaction id's, I do not get a cursor or error.
strTrans is generated before the CursorAdapter is created

strTrans = "'AD00001494825','AD00001495243','AD00001495343','AD00001495351','AD00001495357','AD00001495363'"
The SelectCmd for the Parameterized query is:

text to This.SelectCmd noshow
select distinct ifs_table_clrled.transaction_id,
ifs_table_clrled.bank_account_code,
ifs_table_clrled.agency,
ifs_table_clrled.ref_trans_id,
ifs_table_clrled.ref_trans_line,
ifs_table_clrled.vendor_code,
ifs_table_clrled.vendor_name
from ifs_table_clrled where
RTRIM(ifs_table_clrled.transaction_id) in
(?strTrans)
and ifs_table_clrled.fisc_year = '2004'
endtext

I'm sure this is a very simple thing that I am screwing up on and appreciated your assistance in advance.
Send me an email when the shouting stops
Next
Reply
Map
View

Click here to load this message in the networking platform