<html>
<body>
<%
' Declaring variables
Dim back_height, arms, data_source, con, sql_select
' A Function to check if some field entered by user is empty
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
' Receiving values from Form
arms= ChkString(Request.Form("arms"))
back= ChkString(Request.Form("back"))
data_source = "DSN=GunnSrvModODBC"
sql_select = "SELECT * FROM ZZ_Chair WHERE back ='" & back & "'" IF arms = 1 { & " AND na <> 0" } END IF
Response.Write sql_select
' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_select
' Done. Close the connection
con.Close
Set con = Nothing
%>
<br />
<h4>Complete...</h4>
<h5>Show Options:</h5>
<form>
<input type="button" onclick="window.location='index.asp'" value="Back"/>
</form>
<hr />
</body>
</html>it's obviously a problem with the sql, it error's on line 22 always around the back = '"& back &"' ... section sometimes after the = sometimes after the second &.
~ Kam

Help


Back to top









