any idea's why this wouldn't work?
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
<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
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Back to top









