小
小小豆豆龙
Unregistered / Unconfirmed
GUEST, unregistred user!
我遇到一个很头疼的问题,就是如何动态建立sql server的表,我的代码如下:
var
query1:tquery;
table_name:string;
begin
table_name:=edit1.Text;
query1:=tquery.create(self);
query1.DatabaseName:=passwd.database1.databasename;
with query1 do begin
sql.clear;
sql.add('create table :table_name(param1 varchar(20),message varchar(140),tflag decimal)');
query1.ParamByName('table_name').asstring:=edit1.text;
execsql;
end;
end;
我的表名由edit控件中输入,但运行是老出错,总是提示找不到参数table_name
请各位高手提点一二,多谢,多谢![]
var
query1:tquery;
table_name:string;
begin
table_name:=edit1.Text;
query1:=tquery.create(self);
query1.DatabaseName:=passwd.database1.databasename;
with query1 do begin
sql.clear;
sql.add('create table :table_name(param1 varchar(20),message varchar(140),tflag decimal)');
query1.ParamByName('table_name').asstring:=edit1.text;
execsql;
end;
end;
我的表名由edit控件中输入,但运行是老出错,总是提示找不到参数table_name
请各位高手提点一二,多谢,多谢![]