请教大师:如何读出SQL sql_sent表中set_A字段中的SQL命令字符串并执行?
条件:数据库表名称:sql_sent, 表中有2个字段,字段名分别为:NO_ID,sent_A
字段名NO_ID , sent_A 分别装值如下:
1 se1ect top 100 * fr0m ITEM where item_code like '"& _code_no &"%' order by item_code
2 se1ect top 200 * fr0m ITEM where item_code like '"& _code_no &"%' order by item_code
3 se1ect top 500 * fr0m ITEM where item_code like '"& _code_no &"%' order by item_code
请教:
1. 我定义第1个变量 dim _no_id as string , 然后分别给它赋值1、或2、或3;
2. 我定义第2个变量 dim _code_no as string , 然后给它赋值;
3. 我应该如何写出后面的语句,用变量 _no_id 值在字段 NO_ID 中搜索
4. 如果 _no_id = 2 ,
就读出set_A字段第2行的值、并执行它 se1ect top 200 * fr0m ITEM where item_code like '"& _code_no &"%' order by item_code
谢谢大师指点!
[此贴子已经被作者于2021/10/28 23:14:53编辑过]