Warning: 回复人: zx_wang(wzx) sql='select * from table1 where id='+gid; 这句显然不对,gid是Integer型变量!怎么与字符串做+运算?!人家是要在Filter中!写的Select * From Table1 Where ...... 这样的语句,它能接受吗?!不解中。
对不起,没有看清题。前面写错了。见谅 你的gid是一个整形的话,那就写为 sql='select * from table1 where id='+gid; 不过在有些数据库里面,将一个整形用引号引起来也没错
sql='select * from table1 where id='+ inttostr(gid)如果gid是整数型的
sql='select * from table1 where id=''+gid+'''
Filter := Format('id=%d', [gid]);
/////////////////////////
也不行,请问你用它试成功过吗?
你在Query右击,点Fields editor....然后再右击.
添加所有字段.
回复人: zx_wang(wzx)
sql='select * from table1 where id='+gid;
这句显然不对,gid是Integer型变量!怎么与字符串做+运算?!人家是要在Filter中!写的Select * From Table1 Where ......
这样的语句,它能接受吗?!不解中。
你的gid是一个整形的话,那就写为
sql='select * from table1 where id='+gid;
不过在有些数据库里面,将一个整形用引号引起来也没错
或者用数据库的转换函数,具体函数根据数据库不同而不同,查一下你用的数据库函数资料吧。
sql='select * from table1 where id='''+ inttostr(gid)+''''
你可以试试
写法如下:
sql='select * from table1 where id='''+ inttostr(gid)+''''
你可以试试
sql='select * from table1 where id='+inttostr(gid);
还有就是你的gid一定要是integer的