Advertisement
| 09.29.2008 at 09:44AM PDT, ID: 23772006 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: |
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
'see if item exists BEFORE trying to insert into database
Function itemExists()
Dim qSQL
Dim conn
Dim rs
Dim totalrecs
Dim result
'inittize totalrecs
totalrecs=0
'initialize result
result=""
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.RecordSet")
'open database connection
conn.Open "test"
'query here
qSql ="SELECT Count(*) as reccount FROM tbltest" + " WHERE fldtest=" + "'" + "Apple" + "'"
'execute query here
Set rs = Conn.Execute(qSQL)
'assign record count to totalrecs
totalrecs = rs("reccount")
'debug
'response.Write(cint(totalrecs))
if cint(totalrecs) > 0 then
'debug
'response.write("True")
result=True
end if
if cint(totalrecs) = 0 then
'debug
'response.write("False")
result=False
end if
' Close the Recordset object and destroy it
rs.Close
Set Rs = Nothing
conn.Close
Set Conn = Nothing
itemexists=result
'debug
response.Write("<br>")
response.Write(itemexists)
End Function
%>
<%
'insert record here
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<p><a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?teststuff=1">Click Me</a>
<%
teststuff = Request.QueryString("teststuff")
If teststuff = 1 Then
Call itemexists
End If
%>
</p>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>
|
Advertisement