Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jul : TWebBrowser showing DB data

www.cryer.info
Managed Newsgroup Archive

TWebBrowser showing DB data

Subject:TWebBrowser showing DB data
Posted by:"Rael" (nospam@news.groups.com)
Date:Tue, 5 Jul 2005 12:21:49

Hi,

I'm trying to get a TWebBrowser show data from a DB - (html source in memo
type field). I want the contents of the WB to change as the user moves to
a
different record (with DBNavigator).

So in the Table AfterScroll event I have:

procedure TForm1.ADOTable1AfterScroll(DataSet: TDataSet);
begin
  BrowserLoadString(WebBrowser1, DataSet.FieldByName('Books').AsString;);
end;

procedure BrowserLoadString(AWebbrowser : TWebBrowser; s : string);
Var
  Doc : Variant;
Begin
  AWebBrowser.Navigate('about:blank');
  Doc := AWebBrowser.Document;
  Doc.Clear;
  Doc.Write(s);
  Doc.Close;
End;

The WB correctly shows the data when the app starts, but becomes blank
after
moving to a new record. If I include WebBrowser1.Update in the AfterScroll
event, the data shows for a split second but then the WB goes blank.

Can anyone tell me how to achieve my aim?

Thank you,
Rael

Replies:

www.cryer.info
Managed Newsgroup Archive