Dear Sir,
I am having a problem in following code :
I have marked the error line in bold:
<html>
<head>
<title>Delete Entry Select</title>
</head>
<body bgcolor="white" text="black">
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGuestbook 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query for the database
Dim confirm
'MsgBox "sdf"
'confirm = MsgBox("Are you sure want to delete it?", 4, "Confirm")
'If confirm = vbYes Then
'MsgBox "hello"
'ElseIf confirm = vbNo Then
'MsgBox "Sorry"
'End If
'End Sub
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb")
'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=guestbook"
'Create an ADO recordset object
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblComments.* FROM tblComments;"
'Open the recordset with the SQL query
rsGuestbook.Open strSQL, adoCon
Sub button_onclick()
Dim x
For x = 0 to rsGuestbook.recordcount
If Form1.elements(x).checked = True Then
MsgBox "hello"
End If
Next
End Sub
Response.Write ("<form name='Form1'>")
'Loop through the recordset
Response.Write ("<br><table border=1 bordercolor=red width='50%' style='border-collapse:collapse'>")
Response.Write ("<br><th align='left'>Select here</th><th align='left'>Name</th><th align='left'>Comments</th>")
Do While not rsGuestbook.EOF
'Write the HTML to display the current record in the recordset
'Response.Write ("<a href=""delete_entry.asp?ID=" & rsGuestbook("ID_no") & """>")
'Response.Write (rsGuestbook("Name"))
'Response.Write ("</a>")
'Response.Write ("<br>")
'Response.Write (rsGuestbook("Comments"))
'Response.Write ("<br>")
Response.Write ("<tr><td width='10%' align='center'>")
Response.Write ("<input type='RADIO' name='ID' value='rsGuestbook('ID_no')'>")
'Response.Write ("<a href=""delete_entry.asp?ID=" & rsGuestbook("ID_no") & """>")
'Response.Write (rsGuestbook("Name"))
'Response.Write ("</a>")
Response.Write ("</td><td width='25%'>")
'Response.Write ("<a href=""delete_entry.asp?ID=" & rsGuestbook("ID_no") & """>")
'Response.Write ("<td width='25%'>")
Response.Write (rsGuestbook("Name"))
'Response.Write ("</a>")
Response.Write ("</td><td width='25%'>")
Response.Write (rsGuestbook("Comments"))
Response.Write ("</td></tr>")
'Move to the next record in the recordset
rsGuestbook.MoveNext
Loop
Response.Write ("</table><br><br>")
Response.Write ("<input type='submit' value='Delete' name='button'>")
Response.Write ("</form>")
'Reset server objects
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>
</body>
</html>
Please help me sir.
Thanks
Deepak