Forum Moderators: open
<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>
Name:</FONT>
<INPUT id=text1 name=txtName style="WIDTH: 159px; HEIGHT: 22px">
<BR>Email:
<INPUT id=text1 style="WIDTH: 159px; HEIGHT: 22px" name=txtEmail>
<BR>Phone:
<INPUT id=text1 name=txtPhone style="WIDTH: 158px; HEIGHT: 22px" >
<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>
<INPUT type=submit value=Submit name=Submit>
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 :)
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