Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Parameterizing SelectCmd in CursorAdapter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00925805
Message ID:
00925923
Vues:
13
This kind of syntax for IN clause is not supported by SQL Server. You are going to have to build the SELECT command as you did it in the first example.

>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.
- Jayesh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform