From: Metre Meter on
On Jan 6, 3:31 pm, "Bob Barrows" <reb01...(a)NOyahoo.SPAMcom> wrote:
> Metre Meter wrote:
> > - What are the issues with mixing languages in Classic ASP? For
> > example, declaring variables, functions etc. in one language and
> > accessing/calling them in another?
>
> http://classicasp.aspfaq.com/general/does-order-matter-when-using-dif...

Yes, I'd come across that issue before, but that page lays it out
particularly clearly, thank you. It can definitely be a nuisance if
you don't understand that. :-/

> better asked in a dotnet group (this is a classic asp group)
>
> microsoft.public.dotnet.framework.aspnetwww.asp.net

Will do, thank you.

> > - What environment does Classic ASP operate within (i.e. analogous to
> > ASP.Net programs operating under CLR)?
>
> Not sure I understand the question. ASP is run by an IIS server using
> asp.dll

Sorry, that was badly phrased, probably because I hadn't thought it
out too well. Is there a resource that gives an overview of how the
different parts of IIS (including Classic ASP) work together, which
parts do what, and which processes run which, etc.?

> > Do I have more direct
> > access to Windows' native features under Classic ASP, or does that
> > restrict me in a different way? Is there anything in that vein that I
> > can do in Classic ASP that I can't do in ASP.Net?
>
> Are you talking about access to the windows api? Don't even think about
> it with script languages, which is all that classic ASP supports.

But the methods I can call on the Server.CreateObject created objects
are those of the same ADO COM object created by any other machines
(barring security considerations), right?

> doesn't seem to be a question

It was a side-note for the previous question

> - Which is the best way to stucture my programs made up of multiple
> > files?
> >     - Via #includes or via <script> tags?
>
> For server-side code, I typically use server-side includes (#includes).

I get the impression that it's more a matter of personal choice (at
least as far as Classic ASP goes)?


> > but how do I include a jscript file within a jscript fileif there are
> > dependencies
> ??? just do it?
> Are you talking about client-side or server-side code?

Server-side JScript; e.g. if we have file foo.js which contains...
var blah = "whatever";

function some_function(in_param) {
return blah + another_function(in_param);
}

Then we have to include foo.js in our ASP file ("parent.asp") like
so...
<script language='jscript' runat='server' src='foo.js'></script>

But... some_function() in foo.js uses another_function(), which is
defined in bar.js, so we need to include that. But we can't include
<script> tags within foo.js itself, nor #include, because it's a
JScript file. We can of course add
<script language='jscript' runat='server' src='bar.js'></script>
in "parent.asp", but we have to remember to do that ourselves. Or
perhaps we should just #include our code file instead, like you said?

> > - What "type" of object does Server.CreateObject in Classic ASP
> > create?
>
> Whatever type is provided by the type library being referenced ...
>
> set rs=createobject("adodb.recordset") causes the creation of an ADO
> recordset object and returns a reference to it to the rs variable.

So it's generally a COM object of some sort?

Thanks for the feedback,

- MM
From: Metre Meter on
On Jan 6, 4:06 pm, Tim Slattery <Slatter...(a)bls.gov> wrote:
> Metre Meter <metreme...(a)yahoo.co.uk> wrote:
> >- What "type" of object does Server.CreateObject in Classic ASP
> >create?
>
> An ActiveX component. It's implemented as a DLL, which must be
> registered on the server. I've written such things in both VB and C++.

An ActiveX ADO COM object?

- MM
From: Metre Meter on
On Jan 6, 5:11 pm, "Evertjan." <exjxw.hannivo...(a)interxnl.net> wrote:
> functions and also variables are available to both:

Thanks for all the feedback on this subject.

-MM
From: Bob Barrows on
Metre Meter wrote:
> On Jan 6, 4:06 pm, Tim Slattery <Slatter...(a)bls.gov> wrote:
>> Metre Meter <metreme...(a)yahoo.co.uk> wrote:
>>> - What "type" of object does Server.CreateObject in Classic ASP
>>> create?
>>
>> An ActiveX component. It's implemented as a DLL, which must be
>> registered on the server. I've written such things in both VB and
>> C++.
>
> An ActiveX ADO COM object?
>
It doesn't have to be ADO. ADO is just one of many COm objects available.
For example, you can use CreateObject to instantiate a FileSystemObject:

set fso=createobject("scripting.filesystemobject")

You can even create your own ActiveX (COM) object as Tim described.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


From: Bob Barrows on
Metre Meter wrote:
> Sorry, that was badly phrased, probably because I hadn't thought it
> out too well. Is there a resource that gives an overview of how the
> different parts of IIS (including Classic ASP) work together, which
> parts do what, and which processes run which, etc.?

Bird's-eye view:

IIS is a web server. It processes http requests* from clients, using ISAPI
filters to decide what to do with the requests. For .htm and .html requests,
it simply sends the requested page as the response. For .asp pages, it
passes the request to the asp.dll, which provides the objects described in
the documentation I pointed you at. The server-side script in the requested
..asp file runs and generates html which is written to the response and
passed to the client.

There's really not much more you need to know about the inner workings. But
if you're interested, I suggest you read the documentation I pointed you at
earlier.

>
> But the methods I can call on the Server.CreateObject created objects
> are those of the same ADO COM object created by any other machines
> (barring security considerations), right?

Other machines? No, it can only access activex dlls that are installed
(registered) on the machine on which the script is running.

> I get the impression that it's more a matter of personal choice (at
> least as far as Classic ASP goes)?
>

Yes. Personally, I always use ssi's for server-side code, or bits of html
that need to be used in multiple files.


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"