Разработка технологии создания дистанционных курсов на примере курса "Администрирование DB2", страница 48

  Key := Char(TempKey);

end;

procedure TSQLFormX.PaintEvent(Sender: TObject);

begin

  if FEvents <> nil then FEvents.OnPaint;

end;

procedure TSQLFormX.Set_AutoScroll(Value: WordBool);

begin

  AutoScroll := Value;

end;

procedure TSQLFormX.Set_AutoSize(Value: WordBool);

begin

  AutoSize := Value;

end;

procedure TSQLFormX.Set_AxBorderStyle(Value: TxActiveFormBorderStyle);

begin

  AxBorderStyle := TActiveFormBorderStyle(Value);

end;

procedure TSQLFormX.Set_Caption(const Value: WideString);

begin

  Caption := TCaption(Value);

end;

procedure TSQLFormX.Set_Color(Value: OLE_COLOR);

begin

  Color := TColor(Value);

end;

procedure TSQLFormX.Set_DoubleBuffered(Value: WordBool);

begin

  DoubleBuffered := Value;

end;

procedure TSQLFormX.Set_DropTarget(Value: WordBool);

begin

  DropTarget := Value;

end;

procedure TSQLFormX.Set_Enabled(Value: WordBool);

begin

  Enabled := Value;

end;

procedure TSQLFormX.Set_Font(const Value: IFontDisp);

begin

  SetOleFont(Font, Value);

end;

procedure TSQLFormX.Set_HelpFile(const Value: WideString);

begin

  HelpFile := String(Value);

end;

procedure TSQLFormX.Set_KeyPreview(Value: WordBool);

begin

  KeyPreview := Value;

end;

procedure TSQLFormX.Set_PixelsPerInch(Value: Integer);

begin

  PixelsPerInch := Value;

end;

procedure TSQLFormX.Set_PrintScale(Value: TxPrintScale);

begin

  PrintScale := TPrintScale(Value);

end;

procedure TSQLFormX.Set_Scaled(Value: WordBool);

begin

  Scaled := Value;

end;

procedure TSQLFormX.Set_ScreenSnap(Value: WordBool);

begin

  ScreenSnap := Value;

end;

procedure TSQLFormX.Set_SnapBuffer(Value: Integer);

begin

  SnapBuffer := Value;

end;

procedure TSQLFormX.Set_Visible(Value: WordBool);

begin

  Visible := Value;

end;

procedure TSQLFormX.Action6Execute(Sender: TObject);

begin

 //

end;

procedure TSQLFormX.Help1Click(Sender: TObject);

begin

//

end;

procedure TSQLFormX.ActiveFormCreate(Sender: TObject);

var i:longword;

begin

 ClientDataSet1.CommandText:='SELECT count(*) from KOSTIK.TDATA';

 ClientDataSet1.Open;

 needpageChange:=true;

 if ClientDataSet1.Fields[0].AsInteger <= 1 then SpeedButton2.Enabled:=false;

 slaidid:=1;

 sldcnt:=ClientDataSet1.Fields[0].AsInteger;

 setLength(results,sldcnt);

 tries:=3;

 for i:=0 to sldcnt-1 do results[i]:=false;

 Label2.Caption:='1 из ' + ClientDataSet1.Fields[0].AsString;

 ClientDataSet1.Close;

 ClientDataSet1.CommandText:='SELECT TASK from KOSTIK.TDATA where ID=1';

 ClientDataSet1.Open;

 RichEdit1.Lines.Clear;

 try

  RichEdit1.Lines.Add(ClientDataSet1.Fields[0].AsString);

 except on e:Exception do;

 end;

 ClientDataSet1.Close;

end;

//procedure TSQLFormX.TestSQL;

//begin

//end;

procedure TSQLFormX.Image3MouseMove(Sender: TObject; Shift: TShiftState; X,

  Y: Integer);

begin

 if (x<0) or (y<0) then begin

  // ReleaseCapture;

   //Image3.Picture.Bitmap.FreeImage;

   //ImageList1.GetBitmap(0,Image3.Picture.Bitmap);

  //// Image3.Repaint;

 end

 else begin

 // Image3.Picture.Bitmap.FreeImage;

  //ImageList1.GetBitmap(1,Image3.Picture.Bitmap);

  //Image3.Repaint;

//  SetCapture(SQLFormX. .Handle);

 end;

end;

procedure TSQLFormX.SQLServerConnectionLogin(Sender: TObject; Username,

  Password: String);

begin

  SQLServerConnection.AppServer.Login(UserName, Password);

end;

procedure TSQLFormX.DeleteBadCharacters;

var i,j:integer;

    wasSpace:boolean;

begin

 sqltext:=Memo2.Text;

 SetLength(sqltext,Length(Memo2.Text)+40);

 wasSpace:=false;

 i:=1;

 j:=1;

 while Memo2.text[i]=' ' do inc(i);

 dec(i);

 while i<=Length(Memo2.Text) do begin

  inc(i);

  if (Memo2.Text[i]=' ') then begin

   if wasSpace then continue

   else begin wasSpace:=true; sqltext[j]:=' '; inc(j); continue; end;

  end;

  if (Memo2.Text[i]=#13) then begin

   if wasSpace then continue

    else begin sqltext[j]:=' '; wasspace:=true; inc(j); continue; end;

  end;

  if (Memo2.Text[i]=#10) then begin

   if wasSpace then continue

   else begin sqltext[j]:=' '; wasspace:=true; inc(j); continue; end;