亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

請問怎么搞的???為什么顯示這么多錯誤?多謝??!

unit Unit3;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, ExtCtrls, StdCtrls;typeTCR1 = class(TForm)Panel1: TPanel;Label1: TLabel;Label2: TLabel;Label3: TLabel;Label4: TLabel;Label5: TLabel;Label6: TLabel;Label7: TLabel;Edit1: TEdit;Edit2: TEdit;Edit3: TEdit;Edit4: TEdit;Edit5: TEdit;RadioButton1: TRadioButton;RadioButton2: TRadioButton;Button1: TButton;Button2: TButton;Memo1: TMemo;procedure Button1Click(Sender: TObject);procedure Button2Click(Sender: TObject);private{ Private declarations }public{ Public declarations }end;varCR1: TCR1;implementationuses Unit1, Unit2;{$R *.dfm}procedure TCR1.Button1Click(Sender: TObject);VarXh,Xm,Xb,Cssj,Zy,Zxf,Bz, Sql1,Sql2:String;beginXh:=Edit1.Text;Xm:=Edit2.Text;if RadioButton1.Checked=true thenXb:='1'elseXb:='0';Zy:=Edit4.Text;Cssj:=Edit3.Text;Zxf:=Edit5.Text;Bz:=Memo1.Text;Sql1:='select xh from xs where xh='+''''+Xh+'''';XSCJDM.XSCJADODataSet.Active:=false;XSCJDM.XSCJADODataSet.CommandText:=Sql1;XSCJDM.XSCJADODataSet.Active:=true;if(XSCJDM.XSCJADODataSet.FieldValues['xh']<>NULL)thenshowmessage('該學生記錄已經存在!')elsebeginSql2:='Insert xs values('''+Xh+''','''+Xm+''','+Xb+','''+Cssj+''','''+Zy+''','+Zxf+','''+Bz+''')'; //這里有問題?。。?!XSCJDM.XSCJADOCommand.CommandText:=Sql2;XSCJDM.XSCJADOCommand.Execute;showmessage('插入成功!');end;procedure TCR1.Button2Click(Sender: TObject);beginXSCJGL.Visible:=true;CR1.Close;end;end.錯誤:[Error] Unit3.pas(71): Unterminated string[Error] Unit3.pas(72): Missing operator or semicolon[Error] Unit3.pas(72): Unterminated string[Fatal Error] Project1.dpr(7): Could not compile used unit 'Unit3.pas'
查看完整描述

3 回答

?
波斯汪

TA貢獻1811條經驗 獲得超4個贊

Sql2:='Insert xs values('''+Xh+''','''+Xm+''','+Xb+','''+Cssj+''',
'''+Zy+''','+Zxf+','''+Bz+''')'; //這里有問題?。。?!
改成:

Sql2:='Insert xs values('+
''''+Xh+''''+','+
''''+Xm+''''+','+
'''+Xb+''''+','+
DateToStr(Cssj)+','+
''''+Zy+''''+','+
FloatTostr(Zxf)+','+
''''+Bz+''''+')'; 
以上我假設xh是序號,字符型的,xm是姓名,字符型的,xb是性別字符型的,Cssj時間型的,zy摘要字符型的,Bz備注字符型的。sql2中的引號均為單引號。

查看完整回答
反對 回復 2022-12-18
?
慕婉清6462132

TA貢獻1804條經驗 獲得超2個贊

procedure
TForm1.Button3Click(Sender:
TObject);
  var
  SysTime:
TsystemTime;
  begin
  GetSystemTime(Sys
Time);就用這個函數Get
System
Time
  Caption:=IntToStr(Sys
Time.wYear)+'
'+IntToStr(SysTime.wMonth);
  //if
SysTime.wYear>2000
then
  //
在程序邏輯中利用獲取的各類時間值
  end;試過了,通過,

 


查看完整回答
反對 回復 2022-12-18
?
子衿沉夜

TA貢獻1828條經驗 獲得超3個贊

Statusbar1.Panels[0].Text:=FormatDateTime('YYYY-MM-DD',now);
Statusbar1.Panels[1].Text:=FormatDateTime('hh:mm:ss',now);

查看完整回答
反對 回復 2022-12-18
  • 3 回答
  • 0 關注
  • 139 瀏覽
慕課專欄
更多

添加回答

了解更多

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號