Solved

TClientDataset from ISAPI?

Posted on 2001-07-10
15
495 Views
Last Modified: 2010-04-06
I have a desktop application written in Delphi 4 C/S with all patches applied.  The application loads information from CDS files into a couple of TClientDatasets.  Everything works great.  I then wrote an ISAPI dll that uses the same component.  It errors out on the ClientDataSet.LoadFromFile('myfile.cds');
I get an EOleSysError - Class not registered.  I know about STDVCL40.dll and DBClient.dll.  Both are registered and the desktop app works great.  Just not at all on either Win NT 4.0 Server with IIS 4.0 or Win 2000 with IIS 5.0.  How do I get it to load the file in IIS?  Obviously I am not getting to the classes registered in DBClient.dll where the loadfromfile function is located.  

UPDATE:  The Error is "EOleSysError - Interface not registered".  Everything is on one machine.  Delphi 4 C/S does not have the Midas.dll.  How and when do I use CoInitialize in the ISAPI dll?  I think this may be my problem.  The CDS file is in the scripts directory with the ISAPI dll with read/write permission.  On NT, I see no IUSR_<machine_name> account but I do see it on Win 2000.  Any more information I can give to help?  Can anyone give me an example of using CoInitialize with TClientDataSet in a Delphi ISAPI dll?  Thanks!
0
Comment
Question by:Wildrider49
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
  • +3
15 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6269906
How about midas.dll?
0
 
LVL 7

Expert Comment

by:Motaz
ID: 6271833
What else did you use rather than Midas ClientDataSet, if no thing, then you must copy MIDAS.DLL only as Epsylon stated and it needs no registration.
0
 
LVL 7

Expert Comment

by:Motaz
ID: 6271836
ClientDataSet working fine on my CGI applications
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:ziolko
ID: 6272016
MIDAS.DLL is good idea but remeber You need license for MIDAS.DLL, also remember that ISAPI runs is security context of IUSR_<computername> user and "home" directory is %WINDIR%\SYSTEM32 (not a directory where ISAPI is located), so when reading files from disk You must have apropriate permissions.
ziolko.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6272148
You only need a licence when using it in tiered apps, not when using flat files....
0
 
LVL 21

Expert Comment

by:ziolko
ID: 6272215
Epsylon You are absolutely right
ziolko.
0
 
LVL 4

Accepted Solution

by:
fva earned 200 total points
ID: 6272632
Did you call CoInitialize(nil) when creating the DM?

F.
0
 
LVL 2

Expert Comment

by:Felixin
ID: 6272758
An ISAPI application is a DLL.

The difference between DLL and desktop application is that Delphi automatically makes a CoInitialize for exe files, while it doesn't for DLL.

You should see an error of the type

"A coinitialize call has not been made" (on my own words)


However, you don't see that error, but a 'Class not registered'

Revise

1. The server is correctly registered in the server computer

2. The visibility of the server. You might be trying to connect via a firewall or different network with no confidence relationship.

3. You TClientDataSet (DCOMConnection) points to the correct server

4. The server DCOM config to be sure that you're granting permisiions enough to run the server to the user under which the ISAPI is running.
0
 

Author Comment

by:Wildrider49
ID: 6277550
Worked like a charm!  Why doesn't it show any info on CoInitialize in the help?  Anyway, I am happy to see it working.  Thanks!
0
 
LVL 7

Expert Comment

by:Motaz
ID: 6281830
If it works fine, so whay you don't give him grade A?
0
 
LVL 21

Expert Comment

by:ziolko
ID: 6283291
Felixin > the error You are talking about is " A CoInitialize has not been called" the solve is add CoInitializeEx(NULL,COINIT_MULTITHREADED) remember that every CoInitializeEx() should have corresponding CoUnInitialize()
ziolko.
0
 
LVL 2

Expert Comment

by:Felixin
ID: 6284879
Yes, I knew it because I suffered it.

Thanks
0
 
LVL 21

Expert Comment

by:ziolko
ID: 6285207
Felixin > no pain, no gain :-))) as we all know
ziolko.
0
 
LVL 2

Expert Comment

by:Felixin
ID: 6285227
You're right, but sometimes I wander why Delphi is making such a kind of things.

Why CoInitializeEx is called in a EXE and not in a DLL?. I guess it has to do with the problem of Initializing and Closing fron the same thread, and you cannot contro that in a DLL, can you?.
0
 
LVL 21

Expert Comment

by:ziolko
ID: 6285280
Yeah looks like DLL initialization problem. DLLs written in Delphi cannot read/write files/registry(in entrypoint method) that's what I know but maybe there are more restrictions for calling other DLLs. Controling DLL closeing section is easier.
ziolko.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question