Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.02.13;
Скачать: CL | DM;

Вниз

Ole и база данных paradox   Найти похожие ветки 

 
Virus   (2004-01-22 10:07) [0]

Доброго времени суток.
У меня в приложении есть база парадоксовская в которой есть поле типа OLE. Есть еще в приложении OLECONTAINER. Как их заставить взаимодейстовать. Т.е. из базы в олеконтейнер перегнать или из олеконтейнера сохранить в базе.


 
Строитель   (2004-01-22 10:12) [1]

см. любой TDB... компонент, например, TDBEdit


 
Virus   (2004-01-22 11:05) [2]

Мне нужно чтобы именно из OleConteinera(тип олеконтейнера - Word) можно было сохранять в базе данных. Как это сделать?


 
Строитель   (2004-01-22 11:43) [3]

TDBOLEContainer = class(TOLEContainer)
private
m_DataLink: TFieldDataLink;
procedure SetDataSource(a_DataSource: TDataSource);
function GetDataSource: TDataSource;
procedure DataChange(a_Sender: TObject);
procedure EditingChange(a_Sender: TObject);
procedure UpdateData(a_Sender: TObject);
procedure ActiveChange(a_Sender: TObject);
function GetDataField: string;
procedure SetDataField(a_sDataField: string);
procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK;
protected
procedure Change; override;
published
property DataSource: TDataSource read GetDataSource write SetDataSource;
property DataField: string read GetDataField write SetDataField;
end;

constructor TDBOLEContainer.Create(a_Owner: TComponent);
begin
inherited Create(a_Owner);
m_DataLink := TFieldDataLink.Create;
m_DataLink.Control := Self;
m_DataLink.OnDataChange := DataChange;
m_DataLink.OnEditingChange := EditingChange;
m_DataLink.OnUpdateData := UpdateData;
m_DataLink.OnActiveChange := ActiveChange;
end;

destructor TDBOLEContainer.Destroy;
begin
FreeAndNil(m_DataLink);
inherited Destroy;
end;

procedure TDBOLEContainer.Change;
begin
end;

procedure TDBOLEContainer.SetDataSource(a_DataSource: TDataSource);
begin
if not (m_DataLink.DataSourceFixed and (csLoading in ComponentState)) then
m_DataLink.DataSource := a_DataSource;
if Assigned(a_DataSource) then a_DataSource.FreeNotification(Self);
end;

procedure TDBOLEContainer.CMGetDataLink(var Message: TMessage);
begin
Message.Result := integer(m_DataLink);
end;

procedure TDBOLEContainer.UpdateData(a_Sender: TObject);
begin
{event handler to write the data in the representation of the field to the database record. Posting the data from within OnUpdateData does not trigger a call to OnDataChange.}
end;

procedure TDBOLEContaine.ActiveChange(a_Sender: TObject);
begin
{event handler to take specific action immediately after the dataset transitions into or out of an active state. OnActiveChange is particularly useful for updating objects to reflect changes that occurred while the dataset was not active, as the object can not respond to events while its TFieldDataLink is not Active.}
end;

procedure TxLookup.DataChange(a_Sender: TObject);
begin
{event handler to take specific action when there is a change to the contents of the field. OnDataChange allows the control to respond when the dataset sends notifications that the data has changed.}
end;

procedure TxLookup.EditingChange(a_Sender: TObject);
begin
{event handler to take specific action when the DataSource transitions into or out of an editing state. This event can be used to create visual indications of the editing state in the control that uses this TFieldDataLink.}
end;

// все остальное должно быть понятно...



Страницы: 1 вся ветка

Текущий архив: 2004.02.13;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.027 c
1-38785
Dimich1978
2004-02-03 14:32
2004.02.13
Удаленная инсталляция


14-39082
mrald
2004-01-24 01:34
2004.02.13
Скажите, есть ли


14-39053
Piter
2004-01-19 19:13
2004.02.13
Какие компиляторы поддерживают C# ?


1-38901
Amigos
2004-01-30 18:33
2004.02.13
Toolbar and XP


14-39072
Knight
2004-01-20 21:24
2004.02.13
Прокладка постоянной локалки..