function getstudentbystudentno(studentno:string):tstuden;
var
sql:string;
student:tstudent;
adoquery:tadoquery;
begin
adoquery:=tadoquery.create(nil);
sql:='select id,name,nation from 学生信息'+
' where id='+'''+studentNo+'''';
adoquery:=dahelper.exesqlquery(sql);
if(adoquery.recordcount<1) then
begin
result:=nil;
end
手机打的,累死了,最后的studentno就是id,我想实现模糊查询,后台数据库是sql server2005,这个where句该怎么改
谢谢各位大哥大姐了
var
sql:string;
student:tstudent;
adoquery:tadoquery;
begin
adoquery:=tadoquery.create(nil);
sql:='select id,name,nation from 学生信息'+
' where id='+'''+studentNo+'''';
adoquery:=dahelper.exesqlquery(sql);
if(adoquery.recordcount<1) then
begin
result:=nil;
end
手机打的,累死了,最后的studentno就是id,我想实现模糊查询,后台数据库是sql server2005,这个where句该怎么改
谢谢各位大哥大姐了
解决方案 »
- delphi与sql server中的简单小问题,本人初学,望帮忙!!!
- ORACLE读写BLOB的问题
- 请问DbGrid中如何一直显示DbcheckBox?
- 关于控件
- 放分200严重支持menggirl做版主 -- Pandarus(小熊)
- 如何知道用户切换到我的应用程序。
- 在QUICKREPORT 中,如何在报表打印不满一页时,用空记录填满这一页?高分奉上!
- 新人请教各位前辈,delphi中的'四舍五入'函数和'取整'函数 怎么写的呀?
- 关于统计问题
- 怎样判断一个字符串中特定位置字符等于某个字母,不区分大小写?
- 求java开源 hr!!!!!
- Operator not applicable to this operand type
'select id,name,nation from 学生信息'+
' where id LIKE ''%'+studentNo+'%''';1,% :表示任意0个或多个字符。可匹配任意类型和长度的字符,有些情况下若是中文,请使用两个百分号(%%)表示。
比如 SELECT * FROM [user] WHERE u_name LIKE '%三%'
摘自:
http://www.cnblogs.com/GT_Andy/archive/2009/12/25/1921914.html
' where id LIKE ''%'+studentNo+'%''';
肯定可以的,你在SQL中测试下就知道了
如果没敲错
1L的应该可以的
http://download.csdn.net/detail/veron_04/1644211