checking for empty recordsets !
here is my program :
<%
'declare variables
Dim Conn
Dim Rs
Dim filePath
Dim mysql
dim sqlstmt
dim index
dim temp
dim temp1
dim sqlstmt1
' map the path of the database to a variable
filePath = Server.MapPath("serverdocket.mdb")
'receive the parameter server name and save it to temp
temp= trim(request.form("txtservername"))
temp1=cdate(trim(request.form("txtdate")))
' create ado connection
Set Conn = Server.CreateObject("ADODB.Connection")
set rs= server.Createobject("ADODB.recordset")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
sqlstmt1="select * from activitysoft where servername='" &temp&"' and activitydate ='"&temp1&"'"
' create ado recordset
on error resume next
Set Rs = Conn.Execute (sqlstmt1)
%>
<center>
<br><br><br><br><br><br>
<%
'use delete statement to delete the record
sqlstmt = "DELETE * FROM activitysoft WHERE servername='" &temp&"' and activitydate ='"&temp1&"'"
conn.execute(sqlstmt)
%>
'now if the variables temp and temp1 do exist ,then the record is deleted , else a message "no record found" is returned.how do I do print "no record found" when there are no matching records.
thankzzz
praveen..
|