Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: ISAPI dll and ADO


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Last Post: Sep 22, 2017 7:31 AM Last Post By: Zane Leo
S?ren Alexander...

Posts: 4
Registered: 10/13/00
ISAPI dll and ADO  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2017 7:01 AM
Hi,

I simply can't get my ISAPI dll to work with my SQL Server via ADO. As soon as i try to open a dataset i get an access violation.
We've been deploying the application as a stand alone windows service for years with no problems.
I've tried every variant of Cominitialization i can think of and searched endlessly through ten year old support threads (no new ones seems to exist).
What are the necessary steps?

Running Delphi 10 and IW 14.1.14

T.I.A.

Sören A.
Zane Leo

Posts: 55
Registered: 12/29/09
Re: ISAPI dll and ADO  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2017 12:12 PM   in response to: S?ren Alexander... in response to: S?ren Alexander...
Wrap an exception handler around the code that generates the AV and report the AV reason.

This will help to narrow the issue and advise a solution.

All the best
Scott Gast

Posts: 82
Registered: 4/2/04
Re: ISAPI dll and ADO  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2017 1:34 PM   in response to: S?ren Alexander... in response to: S?ren Alexander...
Sören ,

Can you describe the process you went through when creating the ISAPI from Stand Alone version?

I build both SA and ISAPI with my applications; using the SA version for developer testing and deploy the ISAPI version when developer testing is complete.

If you post a snippet of the offending code, I'll be happy to give it a look.

Scott

S?ren Alexandersson wrote:
Hi,

I simply can't get my ISAPI dll to work with my SQL Server via ADO. As soon as i try to open a dataset i get an access violation.
We've been deploying the application as a stand alone windows service for years with no problems.
I've tried every variant of Cominitialization i can think of and searched endlessly through ten year old support threads (no new ones seems to exist).
What are the necessary steps?

Running Delphi 10 and IW 14.1.14

T.I.A.

Sören A.
Scott Gast

Posts: 82
Registered: 4/2/04
Re: ISAPI dll and ADO  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2017 1:44 PM   in response to: S?ren Alexander... in response to: S?ren Alexander...
If it helps, here is the source code from my SA program DPR and my ISAPI program DPR.

program FancyStandAloneProgram;

uses
Forms,
IWCGLicenseKey,
IWCGHttpApp,
IWRtlFix,
IW.Server.Indy,
IWApplication,
Include in 'Include.pas',
BaseForm in 'BaseForm.pas' {formBase: TIWAppForm},
AFWTypes in 'AFWTypes.pas',
CSVFile in '..\CSVFile.pas',
S2Snax in '..\S2Snax.pas',
ServerMain in 'ServerMain.pas' {formServerMain},
DBSnax in '..\DBSnax.pas',
<<SNIP>>
MailMergeFrame in '..\IntraWeb\MailMergeFrame.pas' {frameMailMerge: TIWCGJQFrame},
EditContactMassTerminationFrame in 'EditContactMassTerminationFrame.pas' {frameEditContactMassTermination: TIWCGJQFrame};

{$R *.res}

begin
// TIWStart.Execute(True);
Application.Initialize;
Application.Title := 'myFancy SA Program';
Application.CreateForm(TformServerMain, formServerMain);
Application.Run;
GSessions.Clear;
end.

/////////////////////////////////////////////////////////////////////

library FancyISAPIProgram;

uses
IWCGLicenseKey,
ISAPIApp,
IWInitISAPI,
UTF8ContentParser,
IWRtlFix in '..\IntraWeb\IWRtlFix.pas',
BaseForm in 'BaseForm.pas' {formBase: TIWAppForm},
AFWTypes in 'AFWTypes.pas',
Include in 'Include.pas',
CSVFile in '..\CSVFile.pas',
S2Snax in '..\S2Snax.pas',
DBSnax in '..\DBSnax.pas',
<<SNIP>>
MailMergeFrame in '..\IntraWeb\MailMergeFrame.pas' {frameMailMerge: TIWCGJQFrame};

{$R *.RES}

exports
GetExtensionVersion,
HttpExtensionProc,
TerminateExtension;

begin
IWRun;
end.
S?ren Alexander...

Posts: 4
Registered: 10/13/00
Re: ISAPI dll and ADO  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2017 11:59 PM   in response to: S?ren Alexander... in response to: S?ren Alexander...
Can you describe the process you went through when creating the ISAPI from Stand Alone version?

Hi Scott.

Unfortunately I have the same problem with a bare bones IW project I created as ISAPI dll from scratch.
I made a simple "Hello world" app. Press a button to display message, OK. Press a button to retrieve string from database, Fail.

S.

PS. I'll see if i can get some useful data out of that AV and get back to you. DS.
Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: ISAPI dll and ADO  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2017 12:35 AM   in response to: S?ren Alexander... in response to: S?ren Alexander...
S?ren Alexandersson wrote:
Can you describe the process you went through when creating the ISAPI from Stand Alone version?

Hi Scott.

Unfortunately I have the same problem with a bare bones IW project I created as ISAPI dll from scratch.
I made a simple "Hello world" app. Press a button to display message, OK. Press a button to retrieve string from database, Fail.

S.

PS. I'll see if i can get some useful data out of that AV and get back to you. DS.

Have you checked if the user configured to run your application pool in IIS has all the privileges required to access your SQL Server? If you are not sure, please try to set a local administrator as your application pool user and give it a try.
S?ren Alexander...

Posts: 4
Registered: 10/13/00
Re: ISAPI dll and ADO  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2017 1:38 AM   in response to: S?ren Alexander... in response to: S?ren Alexander...
If you are not sure, please try to set a local administrator as your application pool user and give it a try

Already tried it.

S.
S?ren Alexander...

Posts: 4
Registered: 10/13/00
Re: ISAPI dll and ADO  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 22, 2017 6:27 AM   in response to: S?ren Alexander... in response to: S?ren Alexander...
I have managed to get it to work (sort of) by creating TADOConnection and TADOQuery dynamically rather than using components on my TUserSession.
Any ideas?

S.
Zane Leo

Posts: 55
Registered: 12/29/09
Re: ISAPI dll and ADO  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 22, 2017 7:31 AM   in response to: S?ren Alexander... in response to: S?ren Alexander...
S?ren Alexandersson wrote:
I have managed to get it to work (sort of) by creating TADOConnection and TADOQuery dynamically rather than using components on my TUserSession.
Any ideas?

S.
Ahhh.... maybe this is the reason. Look at the code snippet in the 3rd last post

https://www.cgdevtools.com/cgforum/viewtopic.php?f=118&t=3383

Good idea to implement it anyway.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02