Conditions
I'm using SQL/ASP, I'm trying to pull a record from one mdb table and copy it to another mdb table, but i'm having some problems.. here is my code:Code:
Sql_sel = "SELECT Top 1 CUSTID FROM cust ORDER by CUSTID DESC"
CUSTID = Sql_sel
response.write(CUSTID)
Line 1, CUSTID being the ID field, cust being the table which holds the records.
Line 3, is a test to see if it pulls the right data, unfortunately it doesn't infact where i was expecting to see the lastest CUSTID displayed it infact just displays Line 1 as i have written it. This mkaes me beleive that i have made a simple syntax error.. can anyone spot any faults?
View Replies
I need to make sure that all the If conditions are true before proceeding, but I'm not getting the synthax right.
If Len(Request("txtFName")) <= 20 and Len(Request("txtLName")) <= 20 and Len(Request("txtAddress")) <= 255
For example in another script, it would look like this:
if (Len(Request("txtFName")) <= 20 && Len(Request("txtLName")) <= 20 && Len(Request("txtAddress")) <= 255)
What's the right VBScript synthax?
View Replies
View Related
<% if Recordset.Fields.Item("Question1").Value = "No" & Recordset.Fields.Item("Question2") = "Null" then %>
This doesn't seem to be working for me. Am I not joining the two conditions correctly?
View Replies
View Related
I want to add another condition in the SQL statement below:
strSQL="SELECT * FROM Table WHERE Subject LIKE '%" & strKeyword & "%' AND ReplyID=0;"
Is this correct?
View Replies
View Related
why do conditions add themselves together if they are ints in a for loop?
for x = (iCurrentPage*10)-9 to iCurrentPage*10 OR searchRS.recordcount
response.write("hello")
next
iCurrentPage = 1
searchRS.recordcount = 4
The two conditions to end the loop add eachother and the loop prints hello 14 times. How can I have two different conditions in my for?
View Replies
View Related
I have a recordset that returns say 5 records. I want to loop through the recordset until three specific conditions are meet in one of the records. Code:
View Replies
View Related
I am working on a login form that asks for either a login number OR first name and password. When all three fields are completed on the form, my query only checks to see if the first condition is true. I need code that keeps users from only filling out the first condition (login) or the second condition (first name and password), but not both. Code:
View Replies
View Related
I'm working on a site which is password protected using ASP and an Access database.
I need to require that new passwords be at least 8 characters and contain at least one character from upper case, lower case, number and special characters. I've searched but haven't found anything that looks like it would work - only scripts to prohibit certain characters.
function mt_valForm(val)
{
var passed = true;
var mt_error = '';
if (val.txtusername.value == ""){passed=false; mt_error+="Please provide a user name
"}
if (val.txtpassword.value == ""){passed=false; mt_error+="Please provide a password
"}
if (val.txtemail.value.indexOf("@") == -1 || val.txtemail.value.indexOf(".") == -1){passed=false;
mt_error+="Please provide a valid email address
"}
if (mt_error!= ''){alert ("There were errors - please correct these:
" + mt_error)}
return passed;
View Replies
View Related