Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    ASP




ASP Vbscript Class Includes


I'm running into a problem with VBSCRIPT classes in ASP. I use a seperate file for each class I use. Some of these class files are included in multiple ASP scripts, but are also included in other include files. So if you can't see the problem already, it is that occasionally the class file will be included twice in the same script, relsulting in the following error:

Microsoft VBScript compilation error '800a0411'

Name redefined

/includes/classes/closableobjectlist.asp, line 2

Class ClosableObjectList
------^

Does anyone know a clean solution for this problem?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Server-side Includes (IIS 5, Classic VBScript)
I am building up a library of Class'es that represent various columns of
table layouts. One often used column is "name" and each occurrence is
treated identically. (What a concept, eh?)

Part of that library of Class'es includes representations of various tables.
(Just let me know if you see a trend going on here.) These Class'es use the
column Class'es.

What I would like to do, but I have yet to find a way around duplicated
names, is to place all the necessary supporting column Class #include's in
the table's Class so that I need only place the table's Class in the module
utilizing them.

I understand entirely why the "duplicate name" error occurs.

What I am looking for is a way around the conundrum that does not require
duplication of code. Any ideas?

XML To Class
how can i generate a asp class from xml schema. (not .net)

Matrix Class
I'm looking for a class or a library of functions for classic ASP 3.0 (no .NET) to manage matrix (bi-dimensional arrays) with simple math functions such as sum on the row/column, shift of row, shift of columns and so on...

Does anybody know if there's something available on the net?

Using Java Class From ASP
I would like to know how to using java class file inside ASP page

I have placed the class file to C:WINNTjava rustlib
also, I have compiled it to 1.1 version

but it always prompt
error '800401e5'
No object for moniker

How can I solve this problems?

How To Use Class Instance In Asp.net
I have a Class and i want to be able to use its instance
example
public class Enrolltest : System.Web.UI.Page
{
MyClass mc = new MyClass();

mc.mymethod();

}

when i do this i get an error telling me there is no name space what should i do .,,.
i dont want to create a dll and add it to assembly and all that stuff.

Class Does't Exist
internet information server does not work. when i try to open any website
from iis it gives error :"Class does not exist"

Detect If A Class
I am working with a bunch of old code so I can really restructure the includes, otherwise I guess I could change all the #include statements to #include-once. Anyway, If I have a file with a class like this:

Class myClass
end class

I get a "name redefined" error. I've been seeing these and indeed from goolge searches, it's because the file is somehow included more than once. This problem doesn't occur for functions and the old code bases just used functions whereas I would like to add some classes. In C you used to be able to detect that at the top of the file and not included the rest of the file if it is allready included. I just want to at least detect it so I don't redeclare the class.

Class Assignment
I'm having problems with getting numbers to add in asp. I cannot find anything in my book on adding numbers together. All it says "you cannot add values from a textbox". I guess I'm having a brain-fart in a major way.

I working on a program to calculate the totals of rainfall for a year. Give the month that has the max and min and show amount, and show average for the year. Can some please tell me where to start or a code snippet to get me back on track. Code:

JAVA Class
I have written a JAVA class.it have compiled with -target 1.1 arguement and I just can instant it twice time.I can instant it at the first time and second time.When I try to instant it anymore,it prompt me "The remote procedure call failed and did not execute." message.What does it mean?

After,I need restart my web server.My java is used to create new socket and connect to other server.I am using getObject("java:classNameHere") method

Template Class
I'm looking for an ASP template class, that's up to par with Smarty. I really need a few functions that Smarty has, like assign, section, custom functions and the ability to use arrays in my templates. I doubt anything like it exists in ASP, but I'm still hoping... anyone know of any template class that comes near Smarty?

Class Does Not Exist
I am running WinXP Pro and have IIS 5.1. I am developing a web site locally - everything was fine until today when I tried to preview the site I got a 'class does not exist' error (in case you ask I have turned off friendly http errors and this is the message I get). This message is also displayed when I try to access my local host.

Template Class
Right now I use difference include files for my header, footer, functions, config, etc. Has anyone had any success with this type of template system? Or maybe there is a better template system everyone is using?

Also, if anyone is familiar with "here document" syntax in PHP, how do I get that type of functionality for my ASP code? I tried creating functions for the header and footer such as getheader(pagename, pageid) but was unable to figure out how to write such a large piece of code to be output by a functions.

MySQL Class
Are there any good free vbscript classes for handling mySQL databases? Or even a good tutorial on how to write a class for mySQL database (in vbscript).

Template Class?
Does anyone know of a good template class/system, which I can use in my ASP pages to seperate HTML from ASP?

Removing The Class Out Of A Link.
I have a link that looks like this

http://www.anysite.com/ class="someclassname"

It looks exactly like the above link (minus the fact that anysite and someclassname are variables)


User-defined Class
This is my user-defined class
class ABC
public CC
end class

I make a instance of it and store it at the session
set ee=new ABC
ee.CC="hi"
set Session("myobject")=ee

But when i retrieve it and access the property of my
object, it said that The object does not support this
property or method, is that ASP cannot do this, or my
code has error?
set eee=Session("myobject")
response.write eee.cc

Expost VB Class Files
I am supposed to create a documentation on all the classess that are created using VB . Is there a way in VB that will generate a html page which shows all the class and methods in it. this way i can cut short the time of writing the all the details....

Can I Get To The Application Object In A Class
I am trying to get to the application object from a seperate class in my ASP
application and I dont want to pass the object in as the class is inherited
to lots of other classes. So i can have something like the following:

Imports System.Web.UI.WebControls.DataGrid

Namespace Classes.Inheritable
Public MustInherit Class EntityCollection

Implements IDisposable

Private mobjDataConnection As Classes.Databases.DBConnection

Public Sub New(ByVal strSQL As String)
mobjDataConnection = Application("DataConnection")
End sub

Problems With Upload Class
I've been developing a fantasy football game in ASP. Its going pretty well, I think i've got to grips with a fair bit of the basics now and time to move on to the more advanced stuff.

I was wondering if anyone had any recommendations as to who provides the most useful upload class. I can upload pictures to the database and have the users view them but I am having trouble with trying to retrieve two types of data from the database, one an image (BLOB) and the other, just standard text. I cant seem to get them to display on the same page. The sample code is: Code:

CLASS DOES NOT EXIST With IIS 5.1 SOLUTION!
Look for wspwsp.dll in windowssystem32 and add IWAM_"computername" (ie IWAM_MYCOMPUTER if MYCOMPUTER is he name of your computer) account with read and write permissions.

The support person who helped me with this issue told me they will create a knowledge base article for it!

Invalid Class String
In an asp page in localhost I have this:

Set x = Server.CreateObject("Scripting.Dictionary")
And I get this error: Invalid class string
If I omit Server like this:
Set x = Server.CreateObject("Scripting.Dictionary")
I get this error: ActiveX component can't create object:
'Scripting.Dictionary'

In the same asp page this works fine:

Set conn = Server.CreateObject("ADODB.Connection")

In a Visual Basic application this works fine, too:

Set x = CreateObject("Scripting.Dictionary")

I reinstalled VB without success. Why do I get "Invalid class string"
in the first case?

Database Util Class
already created a Database Util class using ASP Classic that they would be willing to share which prevents things such as:

-Replaces single tick with double tick so the SQL string is not compromised
-Prevents SQL injection
-Any other SQL prevention code that I am missing here

I have searched and found bits and pieces but I wanted to add this post to also find out what other items I should be concerned about with SQL that I do not have listed.

Java Class File
I would like to use asp to call a java class file with arguments in methods for a web database application.May I know how to call the following class ?
say :

package wkflow;
//all the imports here
public class clsMail(){
public void sendMail(String subject, String Content, String Recipient){
//Some command to post mail;
}
}

I am using Win2000 server's IIS.

Syntax Error W/ Class
I'm having a problem with a class that I made. This page works on the rest of my website, but for some reason gives me this error on my index page. I was wondering if anyone knows what would cause this error. Weird since it works on all my other pages. I would paste code for index but it's rather lengthy.

ERROR:

Microsoft VBScript compilation error '800a03ea'

Syntax error

/madmax/calendar.asp, line 3

Class Calendar

Class To Ease Use Of GetRows()
I was bored this weekend and after reading a couple articles and posts about GetRows() being WAY better than the usual way, I thought I would try and make a class to make it similar to using a recordset.

It's far from finished but I thought I would throw it up here and see what everyone thought. Am I wasting my time? I have no real way of benchmarking the possible improvements but I haven't been able to notice a difference yet. Anyway, you can download it here. The zip includes the class file and an example asp file.

BBCode Function Or Class
I'm getting ready to implement something like BBCode for my Web Control Panel so that clients can use BBcode instead of HTML to enter data into webpages.

I haven't really laid out anything for this, but I was wondering if any of you all have any type of function or class written allready? Depending on how it's written I will want to probably add to it.

My goal is to be able to add a line of code just above the <textarea> on the input form. That code will generate the HTML and javascript nessesary to display the buttons to implement the BBcode (just like on forums).

Then upon submission it will run the form object through a function to convert all bbcode to HTML. And upon editing the content it would convert the HTML to the proper bbcode for display in the <textarea>

The other goal is to make this completely modular for any form. You just include the correct file and the functions/classes are all there.

How To Store A Class In A Cookie And Retrieve?
I have the following script:

<%@LANGUAGE=Javascript%>
<%
var myClass = new LoginInfo();
myClass.sessionID = "1321312131";

Response.Cookies("testingCookies") = myClass;

var recievedCookies = new LoginInfo();
recievedCookies = LoginInfo(Response.Cookies("testingCookies"));

Response.Write(recievedCookies.sessionID);
Response.End();

function LoginInfo()
{var sessionID;}
%>

How to make it work?

Send An Email Using The SmtpMail Class In Asp.net
Ive been trying to send an email (via iis smtp virtual mail server) using the SmtpMail class in asp.net, but i keep getting a failure to deliver message. Is there something im not doing?

MailMessage mail = new MailMessage();
mail.From = "oh_neil@yahoo.com";
mail.To = "to104@gre.ac.uk";
mail.Body = "Test email";
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(mail);

Function/class Like As Recordset Object
i need a object/class/function that return me a array/object like this:

set oDataFromSQLServer = function_or_class(sql)

while oDataFromSQLServer.eof
value = oDataFromSQLServer("colum_name") oDataFromSQLServer.next

next

ps: I donīt want to use a Recordset in this case.
ps2: I don't want to use GetRows in this case, because it doesn't pertmit "string index" like array("columName")

Problem With ASP Class Which Does Not Pass Its Variables
I am fixing a client's Web site and for some reason an ASP class does
not want to use the variables it retrieves when it initialiases.

This is an excerpt of the class and it is enough to show what is not
working correctly: Code:

Object Remote Java Class
Is there a way to access to a remote java class from an HTA Application?

Calling A Java Class In An ASP 3.0 Page
I'd like to know whether it's possible to call Java classes compiled with the latest Sun JDK from an ASP page? All the documentation I've been able to find on the net has referred to the ancient MS JVM and SDK, and I don't seem to be able to get any of the examples to work, so I'd like some idea of whether or not what I'm trying to accomplish is, in fact, workable.

Access Java Class With Moniker
I need to access Java object through an ASP page. I reckon that there
are two ways:

1) If the Java object is registered as a COM then access it through the
ProgID using CreateObject method.

2) Direct access to the java class through java moniker. I am trying to
do this ..but failed to get it working. Code:

ASP Includes?
As im used to using php im not to famillier with asp Is there such thing as a asp include? and how would i do it?

Includes
I have a folder structure that looks something like this.

root
->inc
->files
->system
->->area
->->group
->->->Layer3

etc.

I want to add a include file from the original folder level from the "inc" folder.
The file of where the include will be used is located within the folder named Layer3 folder.

How do I add in the include referencing the file.
Do i just use".."

For every folder level i want to go up to gain access to the file?
Do i just continue to add ".."?

ASP Includes
My web designer created my site with a header include or something to that effect. My question is this: How do I change each page title to what I would like for SEO purposes? When I put the desired title onto each page, my includes/header.asp file "overwrites" the desired title; thus, every static page has the same title. Creating separate include files would work but would take forever. I have even tried leaving the title tag blank in the includes.asp file and add the desired title to each static page, but the title tag doesn't end up in the <head>, just the <body> tag.

Xml Includes
I have a XML file that I've formatted using xsl. now I'd like to include that xml just like a normal file in an asp page.

I have the following code but it's really buggy and sometimes it works and sometimes it doesn't, really confusing!!! Code:

Includes
When writing ASP pages that have include pages, is best to make the include pages as txt, asp, inc??? which format would be the most efficient.

Includes
I've a big include asp file with a lot of function and subs, some of them with a long html code embebed, in this intranet and I'm not sure if I should break it in a several include files in order to improve the performance.

My question is:

leave it as it is because all that code runs into memory only once , say at log in, or
break it in several others, in order to access the code that really is to be accessed.

Includes
I have a table that I am using as a main skeleton for all my pages to use. The problems is that I want other pages to be inserted into a specific cell.

I have a skeleton.asp with 2 rows and 2 columns. I will create pages like company.asp which will have just text in them and they will use the include tag and include the skeleton.asp.

The problem is that I want the text only page to be inserted into the lower right cell on the table in the skeleton.asp. I have seen it done many times but I cannot remember what the tag was that you put in the cell to put the include contents there.

Includes
I have a page that uses includes.It has 1 include to bring in a header, 1 for the menu, and then there is a content area.

This content area I need to change.So, for example, the link would be index.asp page=aPage.asp and it would load my page that page witht the header and menu and for the content area include aPage.asp.

What is the script I can do this with. I tried simply using Response.Write and then just righting the <! #include --> tag with the right page in there, but it just writes that without parsing it and including that page.

Includes And CSS
I have an include, which is used as the header of my site, that has a bit of CSS coding in it. The CSS code along with an unordered list creates an expandable menu. The include works great when you view it at its URL, but the menu doesn't expand when a person has to access dynamic pages.

I have found out that the problem is that when the file is included the code is not inside the <head> tags, so thus the menu doesn't perform, or expand. Is there any snippet of code that could automatically put the CSS inside the <head> tags?

ASP Includes
I am trying to write a little script using includes ... but I am getting errors, I am passing a URL variable to use an include .Code:

<!--#INCLUDE VIRTUAL=Request.QueryString("path")-->

Am I missing something?

Includes Like ISS
I have made my asp pages but the left side navigation menu I want to be an include so if I ever change a link it's easy to update them all by changing the nav.asp file. How can I include the nav.asp file on the other asp sites like adminpanel.asp .

Includes
Can someone comment on the use of SSIs? Do these place a lot of strain on the server?
Also, are "virtual" includes or "file" include directives more efficient?

Build A Database Connections Class In Classic ASP
Wondering about best practices as regarding database connections and usage (MS SQL). Was building a class to contain all of the methods and suddenly wondered if this was the best way? Using a sledgehammer to crack a walnut etc.... Code:

XMLHTTP :: Invalid Class String Error
I am trying to utilise xmlhttp for my website. I have been told that it is on the server (don't have access to the actual server so far as installing components etc.).

But I keep getting an 'Invalid Class String' error.

Is there a way to list out the valid class strings or list the components on a server from a normal asp page (so I can see what is/isn't available).

What are the different alternatives to the line...

[VBS] Set xml = Server.CreateObject("Microsoft.XMLHTTP")[/VBS]
that may be substituted depending on the version of it? Or is there another alternative to xmlhttp that will provide me with the source of a page on another server that may already be installed...?

File Name Or Class Name Not Found During Automation Operation
Could someone point me in the right direction? I've
migrated three FrontPage 2002 websites to a new web
server. Each web site has a Access 2000 database on the
data server.

I have the global.asa on each site pointing
to a .udl file which is pointing to the appropriate access
DB on the data server. We're not allowed to use DSN's.
Front Page 2002 will not allow me to create a network
connection to an Access (only SQL). Only one of the three
web sites work. On the other two I keep getting the
following message when I open an ASP page: Code:

2 Asp Includes, And One Depends On The Other
I have a main file (asp), from which I include 2 different asp files. The second included asp file references an array element deefined and populated in the first include asp file. However, the array value is not being resolved in the second include.

This is not on a Windows server, but rather a UNIX server. However, the host provider claims ASP and SSI support.


Copyright Đ 2005-08 www.BigResource.com, All rights reserved