菜鸟我有一段代码执行sql查询,代码如下:
Form3.Query1.SQL.Clear;
Form3.Query1.SQL.Add( 'Select * from "c:\wlj\database\ldyj.db" where "llh" =: llh ' );
Form3.Query1.Prepare;
Form3.Query1.Params[0].AsString := llh;
Form3.Query1.Open;
以上是代码部分,结果总是报如下错误:
Project wlj.exe raised exception class EDBEngineError with message 'Invalid use of keyword,Token:=?
Line Number: 1'.Process stopped.Use Step or Run to continue.
请大虾给看看错在哪里,该段代码的目的是将表ldyj.db中有字段llh等于变量llh直的记录进行过滤。llh变量是添加新纪录时生成的。
Form3.Query1.SQL.Clear;
Form3.Query1.SQL.Add( 'Select * from "c:\wlj\database\ldyj.db" where "llh" =: llh ' );
Form3.Query1.Prepare;
Form3.Query1.Params[0].AsString := llh;
Form3.Query1.Open;
以上是代码部分,结果总是报如下错误:
Project wlj.exe raised exception class EDBEngineError with message 'Invalid use of keyword,Token:=?
Line Number: 1'.Process stopped.Use Step or Run to continue.
请大虾给看看错在哪里,该段代码的目的是将表ldyj.db中有字段llh等于变量llh直的记录进行过滤。llh变量是添加新纪录时生成的。
Form3.Query1.SQL.Add( 'Select * from "c:\wlj\database\ldyj.db" where "llh" =: llh ' ); Form3.Query1.Params[0].AsString := llh;
Form3.Query1.Prepare;
Form3.Query1.Open;