小弟来散分的,顺便问个小问题.

wangchong1982 2004-05-11 11:05:58
我查询学生信息,按学号查询,想查从sno1到sno2间的学生,学号分别输入到Edit2和Edit3

小弟写了一些代码
query1.Close;
query1.sql.Clear;
query1.sql.Add('select*');
query1.SQL.Add('from student' );
query1.sql.Add('where sno=:between num1 and num2');
query1.parambyname('num1').asstring:=edit2.text;
query1.parambyname('num2').asstring:=edit3.text;
query1.Prepare;
query1.open;
但这有错误,
请教各位大侠应该怎么编才行,若能答,小弟实在感激涕零!!
...全文
38 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
duhailee 2004-05-11
  • 打赏
  • 举报
回复
来晚了。
Shiyl 2004-05-11
  • 打赏
  • 举报
回复
接分
wangchong1982 2004-05-11
  • 打赏
  • 举报
回复

谢谢大家.问题解决了!
yurenjf 2004-05-11
  • 打赏
  • 举报
回复
楼上 的 ok
fyje 2004-05-11
  • 打赏
  • 举报
回复
query1.sql.Add('select *');
query1.SQL.Add(' from student' );
query1.sql.Add(' where sno between :num1 and :num2');
query1.parambyname('num1').asstring:=edit2.text;
query1.parambyname('num2').asstring:=edit3.text;
query1.Prepare;
query1.open;

5,378

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧