Now through program execute SQL script, specific use ADO controls, has filtered comment statements/*... */and GO, but the statement notes - unable to filter out, such as the following: [Tcc_Key] [char] (12) COLLATE Chinese_PRC_CI_AS NULL - applicable v5.0.0.0, v5.2.0.0 later. Above, if -- annotation conforms to separate into a line, there is no problem, can filter out, if it is with the statements on the same line, do not know how to filter out??
CodePudding user response:
Procedure TForm1. Button1Click (Sender: TObject); Var LST: TStringList; S: a string; I: Integer; The begin LST:=TStringList. Create; LST. LoadFromFile (' C: \ a.t xt); For I:=0 to LST. Do the Count - 1 The begin S:=LST [I]; S:=Copy (s, 1, Pos (' - ', s) - 1); LST: [I]=s; end; ShowMessage (LST) Text); LST. Free;