?
Solved

IISSample.Asp2Htm and Form Error

Posted on 2004-11-11
14
Medium Priority
?
315 Views
Last Modified: 2007-12-19
I am having some major problems trying to customize this asp page.  Pasted below is the original code.  For some reason the form is not posting the "UnivID" to the asp page.  I keep getting error page 1.  (I put that in so I could see where it was failing)  If I comment that line out then I get the following error

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/nsurequest.asp, line 21

Invalid class string

I did some research and it said that I might need Microsoft resource kit installed.  I did this and rebooted and I get the same error.  So I guess this is a two part question. Why is the value "UnivID" not getting posted and what is the line 21 error.  

Html Form:

<form onsubmit="return validateForm(this)" method="POST" action="nsurequest.asp">
<p>University ID:<input type="text" name="UnivID" size="20"><br>
Last name:<input type="text" name="LastName" size="20"><br>
<input type="submit" value="Check my record" name="submit"></p>
</form>

ASP Code:

<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Buffer = true ' because of Redirect later
'This function takes a string, searches for it in the patroninfo string, and returns
'the information between that string and the string "<BR>".

Function FindData(srchstr)
x = InStr(1, patroninfo, srchstr, 1)
if x = 0 then ' This means there was no occurrence of the string in the target
FindData = "No information on file."
else
y = InStr(x, patroninfo, "<BR>", 1)
z = Len(srchstr)
FindData = Mid(patroninfo, x + z, y - x - z)
end if
End Function

'Redirect user to the signin page if they are not submitting UnivID or LastName info.
if not Request.Form("UnivID") then Response.Redirect("error1.htm")
if Request.Form("LastName") = "" then Response.Redirect("error2.htm")
Set objASP2HTM = Server.CreateObject("IISSample.Asp2Htm") 'Create an ASPToHTM object

'Use the URL method of the object to pass the user's ID number to the INNOPAC
objASP2HTM.URL("http://novacat.nova.edu:4500/PATRONAPI/" & Request.Form("UnivID") & "/dump")
patronInfo = objASP2HTM.Body

'Store body text in the patroninfo variable
'If no patron record with the submitted ID number, INNOPAC will return an error screen
errmsg="ERRMSG=Requested record not found"

'If error message found within body string, value will be greater than zero, or zero if not found

errchk = InStr(1, patroninfo, errmsg, 1)
Response.Write("<html><head><title>Page title goes here</title></head>")
if errchk > 0 then
' The INNOPAC returned an error, so the record was not found

Response.Write("Text of your User Not Found error message goes here.")
else
' Some record was returned, so get the user's data

userName = FindData("PATRN NAME[pn]=")
userAffil = FindData("AFFIL.[p44]=")
userExpDate = FindData("EXP DATE[p43]=")

'Decide if they logged in properly by checking their lastname against that found in INNOPAC.

userLastName = Left(userName, Len(Request.Form("LastName")))
if StrComp (Request.Form("LastName"), userLastName, 1) <> 0 then
Response.Write("Text of your User Name Mismatch error message goes here.")
else

'Decide if they can use the service by checking for their AFFIL.

if userAffil <> "a" and userAffil <> "b" and userAffil <> "c" then
Response.Write("Text of your User Not Authorized error message goes here.")
else

'Decide if they can use the service by checking their Expiration Date
if IsDate(userExpDate) = False then ' The string found is not a valid date
Response.Write("User Expiration Date Invalid error message goes here.")
else ' The string is a real date
userExpDate = CDate(userExpDate) ' Convert the string to date format
if userExpDate < Date() then ' The user is expired
Response.Write("User Expired error message goes here.")
else ' Show them the page because they meet all the tests
Response.Write("Here is the actual information they need.")
end if
end if
end if
end if
end if
Response.Write("</body></html>")
%>
0
Comment
Question by:hang10z
  • 8
  • 6
14 Comments
 
LVL 19

Expert Comment

by:peh803
ID: 12556293
Please see this link:

http://support.microsoft.com/kb/q249290/

Hope this helps!
peh803
0
 
LVL 19

Accepted Solution

by:
peh803 earned 1000 total points
ID: 12556370
Taken directly from the page, in the event that you don't feel like clicking the link:

RESOLUTION
To resolve this issue, install the IIS Resource Kit components. The DLL automatically registers when the IIS Resource Kit components are installed.

You can purchase the current IIS Resource Kit components at the following Web address:
  http://mspress.microsoft.com/books/1398.htm

The IIS Resource Kit components are also available from the following MSDN Subscription Web page:
  http://msdn.microsoft.com/subscriptions/

If the IIS Resource Kit is installed and you receive the "Server.CreateObject Failed" error message, perform the following steps:
1. Start Registry Editor (Regedt32.exe).
2. Click Edit, and then click Find and search to locate the ProgID of the object you are trying to create (For example, "MSWC.Tools" for Tools). The ProgID is located in the following registry key:
HKEY_CLASSES_ROOT\CLSID\{64D9163F-BA0F-11D0-979C-00A0C908612D}\PROGID.
3. Open the InprocServer32 folder located in the registry key
HKEY_CLASSES_ROOT\CLSID\{64D9163F-BA0F-11D0-979C-00A0C908612D},
and locate the path and name of the DLL that is listed as the default value.
4. Click Start, click Run, and then type the following:
Regsvr32 <pathtodll>\<dllname.dll>.
5. Click Start, click Run, and then type the following: Regsvr32 <<I>DLLName.dll</I>>
6. Run the ASP page.


Good luck!
peh803
0
 

Author Comment

by:hang10z
ID: 12556447
I already tried this.. originally I was using a XP pro machine and I downloaded and installed this package.  I even did the manual reg part.  I could get step 5 to work tho, I entered it like this

Regsvr32 <I>tools.dll</I>
And
Regsvr32 <<I>tools.dll</I>>

and it could not find module...  so then I switched it to win 2000 server, but there is no free toolkit for it.  

I still don't understand why the script was originally coughing on the line:
if not Request.Form("UnivID") then Response.Redirect("error1.htm")

I had to comment it out.. again I did not write this and I am not a 'true' programmer, I am a network admin
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:hang10z
ID: 12556455
** Correction I could NOT get step 5 to work.
0
 
LVL 19

Expert Comment

by:peh803
ID: 12556481
the correct method for registering a dll is to run this at the command prompt:

regsvr32 c:\mydirectory\tools.dll

obviously, you'll want to change the above code to match your appropriate local path to the DLL on your webserver.  Also, it's a good idea to stop IIS before you start messing around with registering / unregistering DLL's.  Another simple command line code for this:  iisreset /stop

and then to restart IIS: iisreset / start

iisreset alone will stop and start IIS.

Hope this helps,
peh803
0
 

Author Comment

by:hang10z
ID: 12556587
Still not working
0
 
LVL 19

Expert Comment

by:peh803
ID: 12556614
what's not working?  the regsvr32 line?  What are you typing into the command prompt?
0
 

Author Comment

by:hang10z
ID: 12556637
No it registered fine..  still getting same asp error
0
 
LVL 19

Expert Comment

by:peh803
ID: 12556708
did you do an iisreset after the regsvr32?
0
 

Author Comment

by:hang10z
ID: 12556734
yes
0
 
LVL 19

Expert Comment

by:peh803
ID: 12557342
Hm, well aside from Microsoft's suggestions on fixing it, I'm not sure how to approach this one; sorry.  Good luck.

peh803
0
 
LVL 19

Expert Comment

by:peh803
ID: 12796412
hang10z -- what was the eventual solution to this?  

once again, sorry I wasn't able to help further...perhaps posting the answer / the method you used to finally get it to work will help future viewers.

Thanks,
peh803
0
 

Author Comment

by:hang10z
ID: 13125821
Basically to use this code I have to install the resource kit as stated above.. I abandoned the idea and had IT services write me a new script.  This code was written in 2000.  Damn you microsoft!!  lol
0
 
LVL 19

Expert Comment

by:peh803
ID: 13125899
Okay --

First of all, thanks very much for the update on the solution.  If future users find this question / have the same problem, they will now know where to go.

Second, please review the grading policy for Experts-Exchange (I've pasted it below, for your reference).

I understand that in the end you had to get a new script written, etc., but since the solution provided was indeed the correct answer to the question asked, a "C" grade (the lowest possible grade that you could give) was not warranted.

Should you wish to do so, you can request a grade change by posting a question in community support:
http://www.experts-exchange.com/Community_Support/askQuestion.jsp

Thanks for your consideration.
peh803

grading policy url: http://www.experts-exchange.com/Community_Support/help.jsp#hi73
-------Begin Grading Policy:----------
Ask 10 Experts this question, and you'll get 10 different answers. One thing is certain: Grading at Experts Exchange is NOT like school. Here's what EE says:

Although we use an A-D scale here at Experts Exchange, it works differently than, say, school grades. If one or more Experts' proposals are accepted as answers, they should usually be given an A or B grade, since they have taken the time to provide you with a working solution. If a possible solution is incomplete - ask for clarification or details before accepting the answer and grading it. People should not be given lower grades because of incorrect grammar or because you just accepted their answer or comment to close the question. Keep in mind, your question and any follow-up comments should be focused so that there can be a specific answer. The following is a good guideline to follow when grading:

A: The Expert(s) either provided you with a thorough answer or they provided you with a link to information that thoroughly answered your question. An "A" can also be given to any answer that you found informative or enlightening beyond the direct question that you asked.
B: The Expert(s) provided an acceptable solution, or a link to an acceptable solution, that you were able to use, although you may have needed a bit more information to complete the task.
C: Because Experts' reliability are often judged by their grading records, many Experts would like the opportunity to clarify if you have questions about their solutions. If you have given the Expert(s) ample time to respond to your clarification posts and you have responded to each of their posts providing requested information; or if the answers, after clarification, lack finality or do not completely address the issue presented, then a "C" grade is an option. You also have the option here of just asking Community Support to delete the question.
Remember, the Expert helping you today is probably going to be helping you next time you post a question. Give them a fair chance to earn an 'Excellent!' grade and they'll provide you with some amazing support. It's also true that a "C" is the lowest grade you can give, and the Experts know that -- so use it judiciously.
-------End Grading Policy:----------

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

809 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