Server object error 'ASP 0177 : 800401f3'
Hi I've been having problems getting the ExecuteTransfer.asp page working using the elementary banking system described in chapter 16
I get the following error:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/3382Ch16/BeginningASP3/Ch16/ExecuteTransfer.asp, line 22
800401f3
I checked with my hosting company to see if it was a problem on the server side they gave me this reply:
"This does appear like a coding error, Line 21 shows you are trying to create an instance from a object class "BankAccount.WSC" but I do not see this class being defined anywhere on this script and that the script is not refering to any other scripts that may contain the definition of this class" I downloaded the pages direct from this website and checked it against the book so would assume it contains everything I need.
Does the BankAccount.WSC need to be registered on the server by hosting company I have asked them this question but to date insist it is a problem with the script from the book.
Code from two relevant pages:
Page 1: Bank.asp
<HTML>
<HEAD>
<%
Dim dcBank, rsBank
Set dcBank = Server.CreateObject("ADODB.Connection")
Set rsBank = Server.CreateObject("ADODB.Recordset")
dcBank.Open strConn
rsBank.Open "SELECT * FROM Account", dcBank
Dim strOptionString
strOptionString = ""
Do Until rsBank.EOF
strOptionString = strOptionString & _
"<OPTION VALUE='" & rsBank("AccountID") & "'>" & _
rsBank("HolderName") & " [" & rsBank("AccountID") & "]" & _
"</OPTION>"
rsBank.MoveNext
Loop
rsBank.Close
dcBank.Close
Set rsBank = Nothing
Set dcBank = Nothing
%>
<TITLE>A First Banking Example</TITLE>
</HEAD>
<BODY>
<H2>Elementary Banking for Very Small Banks</H2>
<H3>Cash Transfer Request - Please enter the following details:</H3>
<FORM ACTION="ExecuteTransfer.asp" METHOD="POST">
Select source account:
<SELECT NAME="SourceAccount"> <%= strOptionString %></SELECT><BR>
Select destination account:
<SELECT NAME="TargetAccount"> <%= strOptionString %></SELECT><BR>
Enter check number: <INPUT TYPE="TEXT" NAME="CheckNum" size="20"><BR>
Enter check amount: $<INPUT TYE="TEXT" NAME="AmtToTransfer" size="20"><BR><BR>
<INPUT TYPE="SUBMIT" VALUE="Process This Check">
</FORM>
</BODY>
</HTML>
Page 2: ExecuteTransfer.asp
<HTML>
<HEAD><TITLE>A First Banking Example</TITLE>
</HEAD>
<BODY>
<H2>Elementary Banking for Very Small Banks</H2>
<H3>This page will execute your Cash Transfer Request</H3>
<%
Dim srcAccountID, destAccountID, intCheckNum, dblAmtToTransfer
Dim srcBalance, destBalance
Dim strAbortReason, blnSuccess
intCheckNum = Request.Form("CheckNum")
dblAmtToTransfer = Request.Form("AmtToTransfer")
srcAccountID = Request.Form("SourceAccount")
destAccountID = Request.Form("TargetAccount")
If srcAccountID = destAccountID Then
Response.Write "Can't transfer funds when " & _
"the source and destination account are the same"
Else
Set objSourceAcct = Server.CreateObject("BankAccount.wsc")
Set objDestAcct = Server.CreateObject("BankAccount.wsc")
objSourceAcct.AccountID = srcAccountID
objDestAcct.AccountID = destAccountID
Response.Write "<B>Prior Balances:</B><BR>" & _
"Source Account ID: <B>" & objSourceAcct.AccountID & "</B> " & _
"Balance: <B>$" & objSourceAcct.Balance & "</B><BR>" & _
"Destination Account ID: <B>" & objDestAcct.AccountID & "</B> " & _
"Balance: <B>$" & objDestAcct.Balance & "</B>" & _
"<BR>" & _
"We are about to transfer <B>" & FormatCurrency(dblAmtToTransfer) & _
"</B> from the source account to the destination account...<BR>"
blnSuccess = objSourceAcct.AddMoney (-dblAmtToTransfer, intCheckNum)
If blnSuccess <> 0 Then
objDestAcct.AddMoney dblAmtToTransfer, intCheckNum
Response.Write "<BR><BR>Cash transfered!"
End If
Response.Write "<BR><BR>Cash transfered!<BR><BR>" & _
"<B>Final Balances:</B><BR>" & _
"Source Account ID: <B>" & objSourceAcct.AccountID & "</B> " & _
"Balance: <B>$" & objSourceAcct.Balance & "</B><BR>" & _
"Destination Account ID: <B>" & objDestAcct.AccountID & "</B> " & _
"Balance: <B>$" & objDestAcct.Balance & "</B>" & _
"<BR>"
End If
%>
</HTML>
Can anybody help shed any light on this, I am new to asp but trying to learn:)your help would be greatly appreciated....
Thanks
Liz
liz
|