Forum Moderators: open

Message Too Old, No Replies

Asp

Microsoft VBScript runtime error '800a01a8'

         

vanjamier

2:08 am on Nov 18, 2004 (gmt 0)

10+ Year Member



Hello
Im new to asp, found this forum
Hope i can get a solution to this problem i have.


<FORM name=thisForm METHOD=post action="">
<META name=VI60_defaultClientScript content=VBScript>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<%
'Local Variables
Dim MdbFilePath
Dim strConnect
Dim objConn

'This statement is for Connection
MdbFilePath = Server.Mappath("Loan.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
strConnect ="Driver={Microsoft Access Driver (*.mdb)};DBQ=" & MdbFilePath
objConn.Open strConnect

'This if for recordset
'Set rs=Server.CreateObject("ADODB.Recordset")
'sql="SELECT * FROM BorrowerTab ORDER BY BorrowerId"
'rs.Open sql, objConn
%>

</P><!-- Borrower Details -->
<P><STRONG>Borrower Details<BR> </STRONG>
<FONT color=black> Id:
<INPUT id=text2 style="WIDTH: 28px; HEIGHT: 22px" size=3 name=txtBorrowerId>&nbsp;
Name:</FONT>&nbsp;&nbsp;
<INPUT id=text1 name=txtName style="WIDTH: 159px; HEIGHT: 22px">
<BR>Email:&nbsp; &nbsp;
<INPUT id=text1 style="WIDTH: 159px; HEIGHT: 22px" name=txtEmail>
<BR>Phone:&nbsp;&nbsp;
<INPUT id=text1 name=txtPhone style="WIDTH: 158px; HEIGHT: 22px" >&nbsp;&nbsp;
<HR>

<%
If request.Form("Submit")= Submit Then
'This statement selects the Borrower table

Dim BorrowerId

Set rs=Server.CreateObject("ADODB.Recordset")

sql="SELECT * FROM BorrowerTab ORDER BY BorrowerId"
rs.Open sql, objConn

If rsBorrowerId.EOF Then
'there are no records redirect user to another page
response.redirect("updateOk.htm")
Else
'there's a record so get the id for this record
id = rsBorrowerId("BorrowerID")
End If

id = Request.Form("txtBorrowerID")
strName = request.Form("txtName")
strEmail = request.Form("txtEmail")
strPhone = request.Form("txtPhone")

sqlstr= "UPDATE BorrowerTab SET BorrowerName = '" & strName & "', Email = '" & strEmail & "', Phone = '" & strPhone & "' WHERE BorrowerId = "&id&" "

set rs=objConn.execute(sqlstr)

response.redirect("addOk.htm")

'Close Recordset
rs.Close
Set rs = Nothing
End If
%>
<!-- Submission Buttons -->
<INPUT type=reset value=Reset name=reset>&nbsp;
<INPUT type=submit value=Submit name=Submit>


This is my error:
Microsoft VBScript runtime error '800a01a8'
Object required: ''

Line 54 which is (If rsBorrowerId.EOF Then)

I read the forums and realised that this issue refers to undeclared variable but im not sure as to which variable i didnt declare.

Please help
Thanks :)

vanjamier

2:24 am on Nov 18, 2004 (gmt 0)

10+ Year Member



Sorrie i realised my mistake, i shouldnt have used
rsBorrowerId instead just rs...

Anyway i have a bigger problem now....
When i click on the application form link..its goes directly to the addOk.htm
I dont have the chance to input in the information and press submit...
No data is inserted into the table too
Hmm, hope u can understand what i mean

mattglet

3:18 am on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Instead of using:
If request.Form("Submit")= Submit Then

Try:
If Request.Form.Count > 0 Then

vanjamier

3:21 am on Nov 18, 2004 (gmt 0)

10+ Year Member



Hey.. thanks for the suggestion

Anyway i tried this
if request.form(submit) = "submit" then
...

And it works..
Im new to asp..
can u explain the significance of the ""?

ajavaly

1:24 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



"submit" refers to the name of your submit button, that's why it needs to be in quotes.