with ADOCommand1 do
begin
str:='create Table';
str:=str+Trim(edit1.Text);
str:='(学号 char(10) not null,姓名 char(10) not null,成绩 char(6) null,';
str:=str+'学分 char(3) null,任课教师 char(10) null)';
CommandText:='';
CommandText:=str;
Execute;
end;运行后出错"第一行:'学号'附近有语法错误"
请问怎么解决啊?
begin
str:='create Table';
str:=str+Trim(edit1.Text);
str:='(学号 char(10) not null,姓名 char(10) not null,成绩 char(6) null,';
str:=str+'学分 char(3) null,任课教师 char(10) null)';
CommandText:='';
CommandText:=str;
Execute;
end;运行后出错"第一行:'学号'附近有语法错误"
请问怎么解决啊?
begin
str:='create Table';
str:=str+Trim(edit1.Text);
str:='(学号 [char](10) not null,姓名 [char](10) not null,成绩 [char](6) null,';
str:=str+'学分 [char](3) null,任课教师 [char](10) null)';
CommandText:='';
CommandText:=str;
Execute;
end;
begin
str:='create Table ''+ str+Trim(edit1.Text)+'' '+
'(学号 char(10) not null,姓名 char(10) not null,成绩 char(6) null,'+
'学分 char(3) null,任课教师 char(10) null)';
CommandText:=str;
Execute;
end;
你每次相加的时候都要再中间加一个空格的
你showmessage看看就应该看出是哪里的问题了吧