with adocommand1 do
begin
close;
commandtype:= cmdtext;
commandtext:=''; //这里要怎么写?
Execute;
end;
--------------------------------------------
用SQL建是:
create table mytable
( name nvarchar(255),
type nvarchar(255),
piece float(8),
fee float(8),
) on [primary]请问要怎么把上边的语句改成能用ADOCOMMAND使用的语句?
begin
close;
commandtype:= cmdtext;
commandtext:=''; //这里要怎么写?
Execute;
end;
--------------------------------------------
用SQL建是:
create table mytable
( name nvarchar(255),
type nvarchar(255),
piece float(8),
fee float(8),
) on [primary]请问要怎么把上边的语句改成能用ADOCOMMAND使用的语句?
如:
create table 'combobox1.text'+'combobox2.text'
var
strSql: string;
begin
strSql:='create table ' + ' + combobox1.text + ' +
' + combobox2.text + ' +
…………………………………………………………………………
………………………………………………………………;
adoquery.Sql.Text:=strSql;
………………………………………………
end;
//是open 还是 ExceSQL 我也不太清楚,没有试过,不过我觉的应该行。
var
//数据表结构定义
TableDef:String='(RowNo Long, Xh char(10), Fymc Char(50),'
+'Fl Double, Qfjs char(100), Fyje Double)';
//数据表名称
TableName:String;
//.....
ADOCommand1.CommandText:='';
ADOCommand1.CommandText:='Create Table '+TableName+TableDef;
ADOCommand1.CommandType:=cmdUnknown;
ADOCommand1.Execute;
//.....
ADOCommand1.CommandText:=
'Create Table '+combobox1.text+combobox2.text+
'(field int;
field varchar(20)
')';
ADOCommand1.Execute;
就这样可以了