DB -> MS ACCESS
#################### 코딩부분########################
1 procedure TForm1.InsertBitBtnClick(Sender: TObject);
2 var
3 s : string;
4 begin
5 s := 'insert into cool
6 (Ace,Bee,Cola,Design,Eve,Fine)'+
7 'values('+ ''''+AceDBEdit.Text+'''' +','+ ''''+BeeDBEdit.Text+'''' +',
8 '+ ''''+ColaDBEdit.Text+'''' +','+ ''''+DesignDBEdit.Text+'''' +',
9 '+ ''''+EveDBEdit.Text+'''' +','+ ''''+FineDBEdit.Text+'''' +');
10 Query1.Close;
11 Query1.SQL.Clear;
12 Query1.SQL.Add(s);
13 Query1.ExecSQL;}
14 end;
#################### 에러부분########################
[Error]cool.pas[5] : Unterminated string
[Error]cool.pas[6] : Unterminated string
[Error]cool.pas[6] : Missing operator or semicolon
[Error]cool.pas[7] : Unterminated string
[Fatal Error]cool.dpr : Could not compile used unit 'cool.pas'
한눈에 다 보이게요
s := s+ 'insert into cool ';
s := s+ ' ( Ace , ';
s := s+ ' Bee , ';
s := s+ ' Cola , ';
s := s+ ' Design , ';
s := s+ ' Eve , ';
s := s+ ' Fine ';
s := s+ ' )'+ ';
s := s+ ' values ( ';
s := s+ ' '''+AceDBEdit.Text +''', ';
s := s+ ' '''+BeeDBEdit.Text +''', ';
s := s+ ' '''+ColaDBEdit.Text +''', ';
s := s+ ' '''+DesignDBEdit.Text +''', ';
s := s+ ' '''+EveDBEdit.TextFineDBEdit.Text +''' ';
s := s+ ' ) ';