是不是SQL语法出错了?
当程序运行到这段代码时,就出现[microsoft][ODBC SQL server driver][sql server]第一行:')'附近有语法错误。
adodc1.refresh 失败
borrowlimit 是借书时限,它的值已经在bas公共模块里通过连接数据库的表获得
public borrowlimit as integer
Adodc1.RecordSource = "select count(*)as num from 借还信息 _
where 读者编号='" & Trim(TxtReaderNo.Text) & "'" _
& "and 还书日期 is null and 续借日期 is null" _
& "and datediff(day,借书日期,getdate())>" BorrowLimit 'datediff返回时间差
Adodc1.Refresh
不知是上面那段代码的语法错误,还是连接数据库错误。
谢谢有经验的高手们看下!