Re: TZF - Connecting to an Oracle Database

Bob Watson <[email protected]> Fri, 27 Feb 2004 07:51:17 -0500
Newsgroups gmane.comp.lang.delphi.topaz
Message-ID <[email protected]>
Well, I have figured this out and thought some
of y'all might have a similar problem sometime
and be interested in my solution.

I accomplished my goal with a browser approach,
as I could not figure out how to use ODBC driver
with Delph 7 Professional, I think you might need
Enterprise version.

I used the TWebBrowser from the internet tab;
performed a query of the database, with the appropriate
key; captured the data in a Memo object; and then
parsed it.  

It was kinda like brain surgery - not much to it if
you know what you are doing.  It took me about a
week of searching the web to figure out how to do
it though - as the TWebBrowser is poorly documented
by Borland's documentation.

The code, in case you are interested is:

// this routine will "fetch" a web page into the TWebBrowser object
// edit1.text is a web address
// I figured this out from Borland's documentation

procedure TForm1.Edit1DblClick(Sender: TObject);
begin
  webBrowser1.Navigate(edit1.Text);
end;

// this routine will get the contents of the browser (including HTML tags)
// and put it into a Memo object
// Once you get the code into a Memo Object, you can parse it
// anyway you choose.  In fact, rather than a memo object, you could
// merely use a    var s:string;  .
// I would have never figured this out using Borland documentation but
// rather found an example on the web

procedure TForm1.Button1Click(Sender: TObject);
var
  DOM : variant;
begin
  DOM := WebBrowser1.Document;
  if Webbrowser1.LocationURL <> '' then
     Memo1.text := DOM.Body.OuterHTML
  else
     ShowMessage('No page available!');
end;


Thanks,
Bob Watson




----- Original Message ----- 
From: "Bob Watson" <[email protected]>
To: <[email protected]>
Sent: Friday, February 20, 2004 11:22 PM
Subject: TZF - Connecting to an Oracle Database


> 
> I have a client at a major university who,
> of course, keeps much of their corporate
> data on an Oracle database.  The application
> I am developing needs just a small amount
> of data from this Oracle database and then
> this data and much more will be stored in
> DBF files.
> 
> I use Delphi 7 Professional ... is there some
> way I can connect to an Oracle database using
> ODBC drivers?  Also, is there a way to query
> the database through some sort of "web object" ...
> I am totally ignorant on this matter, so any help
> whatsoever would be greatly appreciated.
> 
> Thanks,
> Bob Watson
> 
 

--^----------------------------------------------------------------
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt
Or send an email to: [email protected]

TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
--^----------------------------------------------------------------