![]() |
#2
ztx192022-01-11 15:13
|

PUBLIC str_youguan,t_youguan,str_pinzhong,t_pinzhong
str_youguan="select * from youguan"
t_youguan="youguan"
str_pinzhng="select * from pinzhong"
t_pinzhong="pinzhong"
PUBLIC 字符串1,表1,字符串2,表2,字符串3,表3,字符串4,表4,字符串5,表5
字符串1=str_youguan
表1=t_youguan
字符串2=str_pinzhong
表2=t_pinzhong
表_数量=2
连接临时_yk() &&调用远程连接
FOR i=1 TO 表_数量
mystr="字符串"+ALLTRIM(STR(i))
myt="表"+ALLTRIM(STR(i))
ac=SQLEXEC(nhandle,mystr,myt) &&这一步有问题
IF Ac<0
=SQLDISCONNECT(nhandle)
MESSAGEBOX("读取错误!",0,"错误信息")
EXIT
RETURN TO MASTER
endif
ENDFOR
IF ac<0
RETURN TO MASTER
else
=SQLDISCONNECT(nhandle)
MESSAGEBOX("查询成功!")
endif
str_youguan="select * from youguan"
t_youguan="youguan"
str_pinzhng="select * from pinzhong"
t_pinzhong="pinzhong"
PUBLIC 字符串1,表1,字符串2,表2,字符串3,表3,字符串4,表4,字符串5,表5
字符串1=str_youguan
表1=t_youguan
字符串2=str_pinzhong
表2=t_pinzhong
表_数量=2
连接临时_yk() &&调用远程连接
FOR i=1 TO 表_数量
mystr="字符串"+ALLTRIM(STR(i))
myt="表"+ALLTRIM(STR(i))
ac=SQLEXEC(nhandle,mystr,myt) &&这一步有问题
IF Ac<0
=SQLDISCONNECT(nhandle)
MESSAGEBOX("读取错误!",0,"错误信息")
EXIT
RETURN TO MASTER
endif
ENDFOR
IF ac<0
RETURN TO MASTER
else
=SQLDISCONNECT(nhandle)
MESSAGEBOX("查询成功!")
endif
我的问题是如何使变量mystr 表示 "select * from youguan",而不是表示为 字符串1 。myt也是同样的问题