开发者

Executing the contents of a memo on a TADOQuery

开发者 https://www.devze.com 2023-03-05 14:14 出处:网络
I have a really long list of sql commands on a memo, when I try to execute it I get the following error:

I have a really long list of sql commands on a memo, when I try to execute it I get the following error:

Parame开发者_StackOverflowter object is improperly defined. Inconsistent or incomplete information was provided.

The code to execute it:

Query.SQL.Text := Memo1.Lines.Text;
Query.ExecSQL;

I have a vague idea that the error is caused due to the way the query content was added, so, here's how I'm doing it now:

1) Memo1.Lines.LoadFromFile('Patch.sql');

2) Proceed to the query commands

As you can see, the contents of the memo is loaded from a file. Is there any other way to successfully do this?

P.S.: I'm using Microsoft SQL 2008.

Thank you!


It looks like you're not using parameters, so set ParamCheck off

Query.ParamCheck := false;

If there is a colon ":" in a string in the SQL, the TADOQuery thinks it's a parameter

0

精彩评论

暂无评论...
验证码 换一张
取 消