首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

在DELPHI插入记录有关问题

2012-02-08 
在DELPHI插入记录问题procedureTForm_course_result.Button1Click(Sender:TObject)begintryado_temp.Clos

在DELPHI插入记录问题
procedure   TForm_course_result.Button1Click(Sender:   TObject);
begin

  try
  ado_temp.Close;
    ado_temp.SQL.Clear;
    ado_temp.sql.Add( 'delete   from   student_score ');
    ado_temp.Prepared;
    ado_temp.ExecSQL;
    ado_Temp.Close;
    ado_temp.SQL.Clear;
    ado_temp.SQL.Add( 'insert   into   student_score(course_id,student_id,score)   select   course_id,student_id,0 ' '     from   student_selectcourse ');
    ado_temp.Prepared;
    ado_temp.ExecSQL;
except
      application.MessageBox( '数据初始化失败! ', '系统提示 ',0);
      exit;
end;
ado_szye.Close;
ado_szye.Open;
end;

end.


我想把表student_selectcourse的所有记录导入表student_score,并且只导入course_id,student_id,score三个字段内容,为什么调试出错,提示是‘FROM   student_selectcourse 之前有未闭合的引号’?

[解决办法]
insert into student_score (course_id,student_id,score) select course_id,student_id,0 from student_selectcourse

热点排行