Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Intraweb Data access
Thu, Aug 16 2007 4:03 AMPermanent Link

adam
I am setting up an Intraweb web site.

I am tight for time (Smileand have chosen to use DBISAM in non-Client/Server mode, as I am
unsure about setting up the DBSRVR on the WebServer, the site is expecting relatively
little traffic and data access read-only and is not complex.

All my Intraweb DLL has to do is find the path to the Data directory, which contains all
my data files.

My site is set up in a standard way:

mydomain.com/html/ - the DLL goes in here.

mydomain.com/private/data - the DB files are in here.

1. I have tried to use INI files ... but I can't find a way to read an INI file from a DLL.

2. I have tried the absolute path. My provider has said the absolute path to the data
folder is:

f:/userdomains/mydomian.com/private/data/

.... I have tried putting this in but it doesn't work.

--

Any idea?


Adam x
Thu, Aug 16 2007 7:47 AMPermanent Link

The absolute path should work fine. But a relative path from the DLL
location should work too with TIniFile. I use the following code:

function GetDLLFileName: string;
var
   p: array[0..256] of char;
begin
   GetModuleFileName(HInstance, p, 256);
   result := StrPas(p);
end;

 szFileName := ExtractFilePath(GetDLLFileName) + 'debug.ini';
 if FileExists(szFileName) then
 begin
     xIniFile := TIniFile.Create(szFileName);
...

/Matthew Jones/
Thu, Aug 16 2007 10:02 AMPermanent Link

adam
Thanks Matthew

when I use the funtion

  GetModuleFileName(HInstance, p, 256);

I have to add ToolsAPI to the uses clause ... at which point I get an AV saying that
"DockForm.dcu" isn't found.

I have searched my source files high & low & can't find a file DocForm.dcu or .pas ...

I am using Delphi 2007 Enterprise.

What am I doing wrong??

--

... I have got the DLL running (sort of) by using hard-coded paths. The error was actually
due to the fact that I was not passing a hard-coded path to the Session.PrivateDir. In an
EXE this isn't required, as it will use the application directory, but in a DLL it seems
to be required.

With a hard-coded path for the Session.PrivateDir I have my application up, but it seems
terribly flaky. The slightest error seems to make it fall over, often requiring me to
reconnect the Database object. I don't know why it becomes disconnected ... sorry this is
too vague a problem to post here! I don't really expect an answer, but any suggestions
would be gratefully received.

I have DBISAM.DB and Session Objects on my IWServerController. I connect these "onCreate"
of the ServerController ...

It is particularly hard to debug as the EXE version I have on my machine to test doesn't
display the problem ... the issues only arise with the DLL on the server.

(Frown

Adam x







Thu, Aug 16 2007 11:13 AMPermanent Link

Not sure why you want DockForm - the definition is in Windows.pas. We are
talking Windows aren't we?

First thought is to make sure you have the session to auto-name itself
(one of the upper properties). That way it is all unique, and the other
items will be safe for the multi-threaded operation of Intraweb.

Second thought is now is a good time to invest in VMWare and set up a
parallel server so you can test it yourself locally. Debugging on a remote
web server will be hard, and you may crash it and get kicked off!

/Matthew Jones/
Image