AegisIC1
02-11-2007, 11:20 AM
I am trying to create codes that will allow registration signups for events or seminars with limitted seating. Here is the code that I am using but I cant seem to get it to work.
<%@ LANGUAGE="VBSCRIPT" %>
<%
Option Explicit
Dim objConn ' Our Connection Object
Dim objRS ' Our Recordset Object
Dim strSQL ' Our SQL String to access the database
Dim strConnection ' Our Connection string to access the database
Dim i ' a counter variable
Dim var1
Dim var2
Dim ifield
Dim icount
var1=1
var2=10
' -- Create objects
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
' -- Connection String Value
strConnection = "DSN=scott"
' -- Open the Connection
objConn.Open strConnection
' -- Our SQL Statement
strSQL = "SELECT count(*) from tblname;"
'strSQL = "SELECT firstname,lastname FROM tblname;"
' -- Populate our Recordset with data
set objRS = objConn.Execute (strSQL)
if (objRS.BOF and objRS.EOF) then
response.write "No records found"
response.end
End IF
if var1>strSQL then
Response.write("No available seating")
else
Response.write("Seating is available")
End IF
%>
<%@ LANGUAGE="VBSCRIPT" %>
<%
Option Explicit
Dim objConn ' Our Connection Object
Dim objRS ' Our Recordset Object
Dim strSQL ' Our SQL String to access the database
Dim strConnection ' Our Connection string to access the database
Dim i ' a counter variable
Dim var1
Dim var2
Dim ifield
Dim icount
var1=1
var2=10
' -- Create objects
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
' -- Connection String Value
strConnection = "DSN=scott"
' -- Open the Connection
objConn.Open strConnection
' -- Our SQL Statement
strSQL = "SELECT count(*) from tblname;"
'strSQL = "SELECT firstname,lastname FROM tblname;"
' -- Populate our Recordset with data
set objRS = objConn.Execute (strSQL)
if (objRS.BOF and objRS.EOF) then
response.write "No records found"
response.end
End IF
if var1>strSQL then
Response.write("No available seating")
else
Response.write("Seating is available")
End IF
%>