Boolean Expression Not Being Eval'd Correctly?

I have some code that checks security permissions in a DB, and before my conditional statement that checks these permissions, I am writing out both values to see what the statement looks likebefore it is evaluated.

The problem is, it seems to disregard the condition and always returns True, even if the condition should be false...any ideas? I also did some testing to assure that the length of the two values I am comparing is 1, just in case they were possibly holding spaces, and I verified they are numeric as well. I am just stumped here...

Let me also preface this code snippet by saying, I am using this asp script to generate javascript menu choices...and I did include some commented debug statements so I can see what the javascript rendered.. Code:

View Replies


ADVERTISEMENT

Boolean Problem

I've written some code that creates an sql statement in a string to update a boolean value in an access database, however, I dont know what value to give the field to update the boolean value in the access database.
I'll paste some of the code so it makes more sense.....
(note: the 'Booked' Field is the Boolean)

strSql = strSql & " UPDATE HolliesBookTbl SET Booked = '-1' WHERE "

'loop through the checkboxes which were ticked
for i = 0 to ubound(arrVals)
if i = 0 then
strSql = strSql & " DateID = '"& arrVals(i) &"'"
else
'only add the " AND " if this is not the first value
strSql = strSql & " AND DateID = '"& arrVals(i) &"'"
end if

I've been pullinhg my hair out over this

View Replies View Related

Boolean SQL Statement

I have a boolean field in an access database. I want to write an SQL statement which pulls out all records from the table MemberInfo where the field Online = true.

This is my code

sql = "Select * From MemberInfo Where online=true"

This doesn't work, do I need quotes around true?

View Replies View Related

Boolean Search Expressions?

I'm trying to add a search facility to a page that looks for matches in one,
other or both memo fields of a database. The code below works fine if the
visitor types in one word, or the term just happens to exist in one of the
queried fields.

What I'd really like is for a visitor to type in an expression, or query in
the same format as you would use in a search engine and it would find
appropriate matches. Any ideas how I can modify the code below to do this?

View Replies View Related

Boolean Variable Concatination

if a declare a variale say
Dim Flag
and assing it to true a boolean value
Flag = True
and if i try to concatinate it with another string like
mystr="<my-str>" & Flag & "</my-str>"
and if the machine is non english the mystr will contain something like
<my-str>that language characters</my-str>
what should i do to get True in mystr what ever the Language of windows is.

View Replies View Related

Pass Boolean Parameter To JS Function

I have a simple JS function that I want to return a true or false value based on the parameter passed in. At this point of time I receive the error "'True' is undefined". Here is my code:

View Replies View Related

Text File Boolean AND Search Problem

I trying to search a text file using a boolean AND search. What i want to happen is when a user types in type values to search e.g. Name Department (Taylor marketing) i want it to only read out the lines which contain both values.

At present it reads out all lines with Taylor in and all lines with marketing. The code i have so far is: Code:

View Replies View Related

Printing Correctly To A4

I have been asked to produce a web form that can be completed with various customer and product details, populated where necessary/possible from a database. This form then needs to be printed as an A4 document.

I have never dealt with printing from ASP before, but I know that simply trying to print a page to an A4 document causes you to end up with numerous bits of paper, most with almost nothing on.

I also need to ensure that the URL and other details that are apparent if you directly print from a browser are not there.

View Replies View Related

Using Cookies Correctly

How do I save cookies onto a computer propperly? I know how to save them, but whenever I try and do it, the browser just blocks them. So how can I save cookies onto a PC without getting them blocked?

View Replies View Related

Assigning A Boolean Of True Or False To VBScript Variable...

Is there a way I can assign a value of true or false to a VBScript variable? I have a function where I want to initiate a value of false: Would this work? Code:

View Replies View Related

Passing Value Of A Record Correctly?

this is driving me crazy and this forum is my usual last resort when i cant get something working! im trying to add some data to a table (access db). but first i need to find the primary key id of the fields im about to enter. im dealing with dates here, hence the bits of code concerning dates. so far i have: Code:

View Replies View Related

ASP Pages Not Being Served Correctly

I have a new computer that I have iis 5 installed on win xp. I am trying to
run a simple one line asp test file in my wwwroot directory.

In IE 6 it says: HTTP 500 - Internal server error
Internet Explorer

In Netscape 6 it says "Class does not exist."

In my application event viewer, there are no entries from "Active Server
Pages", like I"m used to seeing in my other computers. Usually this entry
says "Service Started" or "Service Stopped". So apparently the asp service
is not running. I thought that uninstalling and reinstalling IIS would fix
it, but not luck.

View Replies View Related

Needs A Way To Make Sure Data Is Correctly Added

How can I make sure that it adds all of the records to the table before I make Added = "True" It is strange, but sometimes, it won't add a record at all and then proceed to Added="True" How can I make sure that rs.Update was successful? Code:

View Replies View Related

Cannot Get To Format The Date Field Correctly

I cannot get the date format correctly in dynamic sql statement, after trying various ways of handling it. I need some help with the date format in the following dynamic sql statement. Any help is appreciated in advance. While running the asp page, I still get an error as Error Type:

Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'Format'

DYNAMIC SQL STATEMENT:

sql = " INSERT INTO tblExpense (ENO, EntryDate, ContractedServiceExpense, "
sql = sql & "TravelExpense, PersonnelExpense)"
sql = sql & " VALUES('" & l_ENO & "', " & Format(l_Date,
"#mm/dd/yyyy#") & ", " & l_contractedserviceexpense & ", "
&l_travelexpense & ", " &l_personnelexpense & ")"

View Replies View Related

SQL Update Query Not Working Correctly

I am currently working on a small website which gives an up to date current count on how many people are available are certain time slots for different areas, this is run of a Microsoft Access Database Backend.

My index script will display all areas and times and then display a link to a form which deducts 1 from the current count. Code:

View Replies View Related

Session.Timeout Not Working Correctly?

I have web forms that frequently expire because users have them up for more than the default 20-minutes without interacting with them. So, I changed the timeout in IIS to 7200 seconds (2 hours, of course) and added a Session.Timeout = 120 to the pages in question. (Am I right that Session.Timeout is in minutes?)

Still, however, the pages seem to be timing-out well in advance of the 2-hour threshold. Have I left something out?

I've skirted around the issue by putting the forms into a framepage and setting a blank frame to refresh every 10 minutes, but I'm not fond of that solution. Plus, I'm just curious why the Session.Timeout setting or IIS timeout setting does not seem to work as advertising (allowing for the fact that I may just be a moron and missed a step).

View Replies View Related

Special Characters Appearing Correctly In Email

I have a form that is being sent using CDONTS. The problem is the form I'm sending has a lot of special characters (it's in Spanish) and while I know how to get the chars to display correctly on the page, they're not showing up correctly in the email.

They either show up like this:
Country : Canadďż˝;

or if I encode them, like this:
Country : Canadá

How can I get the email to display the correct character
Country : Canadá

I'm fairly new to ASP (I'm a PHP programmer) and have no clue how to do it.

I've noticed that the email is not set to encode in any special way like the equivalent for PHP......

View Replies View Related

Aspx Programs Not Parsed Correctly In Netscape

I noticed that when I process my aspx web pages in Netscape that the page is not interpreted correctly. Text boxes that are supposed to have no border, have borders, the font for arial is one size larger than what it is supposed to be, etc. Doe
Netscape plan to fully support the Net Framework system

View Replies View Related

SQL Expression

I am getting Syntax error saying Missing operator in query expression.

sql= "SELECT qryReferral_report.Employee, Sum(qryReferral_report.Amount) AS SumOfAmount, Count(qryReferral_report.ID) AS CountOfID"
sql= sql & " FROM qryReferral_report"
sql= sql & " WHERE (((qryReferral_report.CDate) Between #" & Date1 & "# And #" & Date2 & "#) AND ((qryReferral_report.StatusID)='C'))"
sql= sql & " GROUP BY qryReferral_report.Employee"
sql= sql & " Count(qryReferral_report.ID) DESC;"

I'm not real good at SQL, so I don't know what I'm missing. I think it has to do with the Sum and Count statments.

View Replies View Related

Regular Expression

Can anyone give me a regular expression for finding a URL in a string of
text?

Essentially what I want to do is find URLs in a text string and embed
them in {a href...} tags. However, I haven't used regular expressions
all that much in ASP/VBSCRIPT.

View Replies View Related

Regular Expression

I need to create a regular expression for a date field that works only
in the following format MM/DD/YYYY with the / in the format. No other
format can be inputted into the field. I need 2 numbers for MM 2
Numbers for DD and 4 numbers for YYYY. If the users enter 1 number for
month, 1 for day he should get an alert.

I have this code and thought it was working but it is not.

var RegExPattern = /(d{1,2})W(d{1,2})W(d{4})/;

View Replies View Related

Mismatch In Expression

I cant figure out why I get the following error...

Microsoft JET Database Engine error '80004005'
Type mismatch in expression.
/html/results.asp, line 60

rsSearchResult.CursorType = 0
rsSearchResult.CursorLocation = 2
rsSearchResult.LockType = 1
rsSearchResult.Open()
rsSearchResult_numRows = 0

View Replies View Related

Vb Expression Problem

I am trying to validate an input field that should only accept numeric values no larger than 6 digits to the left of the decimal and up to 2 digits to the right of the decimal. The values to the right of the decimal are optional though.

so the max format should be (xxxxxx.xx)

I tried this format:

"^(d{1,6}.*d{0,2})$"

but this format takes values larger than what i want.

View Replies View Related

Regular Expression

i know there are tutorials for Regular Expressions too, but can a 'simple' example be posted in these forms

View Replies View Related

Regular Expression

I'm going down the road of learing the pattern matching in regular
expressions, and I'm trying to convert the characters into English in my
head so I can see whats happening...

For clarity with this one...

[b]([^]]+)[/b]

Ok - the first thing I did was break it up - because it looks a nightmare
like that...so now I have..3 parts..

[b]

([^]]+)

[/b]

In part 1 I under stand that the is telling the expression that a special
character is coming next, thus escaping the [ and ] respectively, thus ,
and in part 3 I understand the same and also the escaping of the /, thus
- no problems so far...

In part 2 I'm assuming that the brackets are seperating a "pattern" so that
I might reference it as $1 later on, I understand that the [^] are saying
"not enclosed" so therefore it's going to ignore a ], the + sign however
perplexes me - my VBScript book says "Matches the preceeding character one
or more times" - so does that mean the ] just before it, or does it mean the
character OR characters defined within the [ ] etc?

View Replies View Related

ASP Query Expression

is it possible to have a replace() function in an SQL query? I need to use
something like that to be able to sort my "sequential-numbers", which are
actually textfields like this:

98.1
98.10
98.2
98.3
98.4

What I want is to query these numbers, convert them by removing the dot with
the replace command and the sort the recordset on it.

Is this possible?

View Replies View Related

Regular Expression Example

looking for a regular expression example for asp in vbscript. just want to search for a name in some text, possibly display that text.

View Replies View Related

Regular Expression

I'm trying to find a regular expression function to strip contents out of a string which lie between square brackets [].I've got one for chevrons (to remove HTML - as below), but would prefer not to have to replace the chevrons for square brackets first.Code:

function funRemoveHTML( strText )
Dim RegEx
Set RegEx = New RegExp

RegEx.Pattern = "<[^>]*>"
RegEx.Global = True

funRemoveHTML = RegEx.Replace(strText, "")
end function
how I can modify this for square brackets as opposed to chevrons?

View Replies View Related

Regular Expression For URL

I am working on an ASP page which looks in a set of text for web page URLs.

Using the VBScript.RegExp regular expression object, I have this regular
expression:

[a-z]+.[a-z]+.[a-z]+/

And it works well finding URL's such as: windowsupdate.microsoft.com,
www.cnn.com, etc.

However, I have been trying to modify it to ALSO find URL's like this:

www.amazon.com/index/sell/ie6.html?val=1
Or
www.microsoft.com/windowsxp

Any ideas?

View Replies View Related

Evaluation Expression

A client wants have acess to an online databases records controlled by group strings and evaluation strings e.g., each use would have in his client record a group string like this:

[ROOT][ADMIN][ACCOUNTING][ABC PRODUCTS]

And each record in a database would have an evaluation string like this :

([ROOT] OR [ADMIN] OR [ACCOUNTING] OR [FINANCE]) AND [ABC PRODUCTS] OR
[ACME]) etc.

No limit to the number of groups or the complexity of the boolean expression evaluation algorithm. I need an asp function that I will just pass the group string and the evaluation string and it will return True or False as to whether the client can view that particular record. I can't find anything in ASP on the internet though this must be a common database control method for non-browser applications? Has anyone done anything like this in ASP?

View Replies View Related

Regular Expression

I'm making url's out of text starting with "www" etc. but I've got two problems. Firstly, if the string begins with www it doesn't get matched, and secondly, if there's a dot or a comma directly after the url, it becomes part of the url. I hope someone who is better at this than me will be able to help me out. Code:

reg.Pattern = "(s)(www)(S)(S+)"
s = reg.Replace(s, "$1<a href=""http://$2$3$4"" target=""_blank"">$2$3$4</a>")

View Replies View Related

Expression Not Supported

I have a SQL statement here that im trying to troubleshoot, it is coming up with 'join expression not supported'. I have tried the statement in the access database (in msaccess) and it works fine without any errors. The statement is as follows:

Code:

strSQL = "SELECT 'tbl Item.Art_No', 'tbl Item.Description', 'tbl Item.BA', 'tbl Item.Retail Sales Price Incl GST', 'tbl Item Bin SOH.Location', 'tbl Item Bin SOH.Blocked', 'tbl Item Bin SOH.Stock on Hand' FROM 'tbl Item' INNER JOIN 'tbl Item Bin SOH' ON 'tbl Item.Art_No' = 'tbl Item Bin SOH.Art_No'"

View Replies View Related

Understanding Regular Expression

I have been using a regular expression that I don’t uite understand to
filter the valid email address. My regular expression is as follows:

<asp:RegularExpressionValidator id="valValidEmail"
runat="server"
ControlToValidate="txtEmail"

ValidationExpression="^([_a-z0-9-]+)(.[_a-z0-9-]+)*@([a-z0-9-]+)(.[a-z0-9-]+)*(.[a-z]{2,4})$"
ErrorMessage="Invalid Email address."
Display="None">
</asp:RegularExpressionValidator>

Can someone explain me why the email address Join Bytes! is
considered an invalid email address?

Also can someone explain me what the above regular expression means?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved