ISAPI and Databaseaccess (MFC, DAO, ADO, ...)? (attn: longer)
Hello
There is no right or wrong here, you will need to look at how you want to
spend your dev time and the future design and goals for this application.
You can then look to see which dev tool and methods best fit your needs.
ISAPI, ATL Sever (new with VS.Net, and is built on ISAPI), ASP.Net. With
ASP.Net you are not just stuck with ASPX pages. You can create your own
HttpHandlers or HttpModules. An HttpHandler is like ISAPI extension but
runs in the .net framework. HttpModule is like ISAPI Filter but also runs
in framework.
If you already have many static HTML pages you may be able to just change
the Form Action to go to a different handler and be able to reuse the them.
Thanks
Brian [MS]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Philipp Ott" <philipp_ott@hotmail.com>
| References: <eGOpE6TnDHA.1296@TK2MSFTNGP09.phx.gbl>
<OfV8cyZnDHA.2012@TK2MSFTNGP12.phx.gbl>
| Subject: Re: ISAPI and Databaseaccess (MFC, DAO, ADO, ...)? (attn: longer)
| Date: Wed, 29 Oct 2003 11:48:35 +0100
| Lines: 86
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: base64
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <eI3Q2ognDHA.2012@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.platformsdk.internet.server.isapi -dev
| NNTP-Posting-Host: firewall.avalon.at 195.26.203.99
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.platformsdk.internet.server.isapi -dev:3422
| X-Tomcat-NG: microsoft.public.platformsdk.internet.server.isapi -dev
|
| Hello!
|
|
| "David Wang [Msft]" <someone@online.microsoft.com> schrieb im Newsbeitrag
news:OfV8cyZnDHA.2012@TK2MSFTNGP12.phx.gbl...
| > Do you actually need an ISAPI to do this, or can you do this all in an
ASP
| > page?
| >
| > --
| > //David
|
|
| I do have a Visual C++ 5.0 MFC-CGI application, which uses heavily
CDaoRecordset and the Crpe32 4.6 engine. It has some 100 template HTML
pages (and as many forms), which have about 10 different <!-- --> comments
hidden in them and those comments get parsed by the application and then
invoke stuff like setting of session variables, conditional branches
depending on values in session variables, printing of session variables or
return value of subroutines etc.
|
| To speed up things a bit and keep the 550 KB EXE in memory and get rid of
the session-mdb I d like to turn this app into an ISAPI extension.
|
| In the long run I d like to convert it to an ASP.NET/C# project but I
read that all the ASPX C# pages are single form pages and it is very hard
and tricky to make differnt forms into one ASPX page (with the help of
setting stuffs visible and not etc) but anyway, there is no elegant
solution yet (that I see). Also I d like to "automagically" turn my HTML
pages into ASPX pages, at least to avoid to code/design 100 times again the
forms - since all of the info is there in the HTML anyway and to write a
converter i dont know yet enough about ASPX...
|
| Also I d like to stay with the Access-MDB and not migrate to a costly SQL
server, since up to now, 10 concurrent users can work fine from Mo-Fr
7:30am to 5pm :-). 4 ppl work connected to the server by LAN and usually
3-5 ppl out of 150 partners from outside the internet. Also I wouldnt know
how to convince the customer of a costly SQL server solution unless the app
starts falling apart under heavy load. Also the application was developed
in early 1996 and went online in mid-1996 with the then-current hardware.
|
| So currently I d like to turn this into an ISAPI extension to get rid of
the session-mdb, the CGI startup time and the loading of the template HTML.
Unless there is some report to inlude or so the buttoncode(), callbacks()
and run() codes executes unmeasurable quick, however to start the cgi, open
the 2 databases takes time (from milliseconds to even 10th of a second) and
the file-reading of the template-pages also
|
| thanks
| Philipp Ott
|
|
|
| Here is an abstraction of the CGI application.
|
|
|
|
| int main
| {
| CGI *me = new CGI(argc, argv);
| me->InitInstance("c:\customer\customer.mdb");
| me->OpenSession("c:\temp\session.mdb");
| me->PerformButton();
| me->LoadTemplate();
| me->Run();
| me->ExitInstance();
| delete me;
| exit (0);
| }
|
| CGI:InitInstance
| {
| // some init code
| }
|
| CGI:OpenSession
| {
| // loads the database and hashes the QUERY_STRING and all
| // HTTP variables into an array of Name, COleVariant value
| // looks for a sessionid
| // if there is an sessionid f merges session-data with array
| // if not set template to "default-login" template and creates a
session f
| // in the session mdb and returns
| }
|
| CGI:PerformButton
| {
| // walks through the array and looks if a set value
| // matches with a name of the available button-callbacks
| // and if so calls this routine
| }
|
| CGI:Run
| {
| // parses the html template
| // and substitutes <!-- CMD parameter --> with the result
| // like <!-- INCLUDE myreport.rpt --> runs report and
| // injects the HTML output into the template
| // or <!-- PRINT sessionvar -->
| // or <!-- VAR somehtmlvar --> generates <input name=somehtmlvar ....
| // or <FORM> with <FORM app=me encoding=etc> and injects a hidden form
| // variable f with the sessionid
| // etc.
| }
|
|
| usuall button routine:
|
|
| bool performSomeButton(CGI *me)
| {
| // process form values and then depending on this
| // set template to appropiate "next" page
| if (ok) me->LoadTemplate("loadcontractinfostep2.html"); | else | {
| me->SetVariable("errorline", "plz enter all fields appropiate");
| me->LoadTemplate("loadcontractinfostart.html");
| }
| // if i want to store a session variable i simply call
me->SetSession("name", COleVariant whatIwant);
| // if i need a session variable i simply call COleVariant x=
me->GetSession("name");
| }
|
| usuall callback routine (invoked by the Run() from a template like CALL
"performSomeCallback")
|
| bool performSomeCallback(CGI *me) | {
| // usually used to create <table>'s of database lists,
| // or to create <select>'s based on some database tables
| me->writestream(my_result); // injects the string into the template
instead of the comment
| }
|
|
|
|