I have an asp page that gets populated from a SQL Server database. Normally when the page gets displayed it displays the current record from a select statement that can return lets say seven records.
The problem I am having is when I click the refresh button in IE, the page displays another record instead of the record it was displaying before I clicked on the refresh button.
I cannot figure out why it is doing this. Has anyone experienced a similar problem? If so, what solution did you come up with.
I have a application that runs an asp page launched by an onunload event of a page. If the user types a URL into the address line of the browser, i need to be able to redirect him to that page once i've finished with my onunload script. Is there a variable/property that lets me get hold of that typed UTL?
I am trying to figure out how to find the URL a browser is requesting if the user did not follow a link but typed the URL into their browser (or linked from an email message.) Similar to using HTTP_REFERER; except that header is blank if they did not click a link.
The object is to forward/redirect any request for pages at one domain to a totally different domain but maintain the complete path requested. It would be a non-issue if I had access to the DNS servers, but alas, I do not.
I am mainly an ASP coder and am only just beginning to look at ASP.NET, which I believe may hold the answer because there doesn't seem to be one using ASP.
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.
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.
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.
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?
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.
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?
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?
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>")
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'"
I am trying to make my update page work, but when i submit the form it comes with this error "mismatch in criteria expression" and the problem i think lies on one of my menu list that is joined to another table in the database.
I'm trying to return a sub string using the regular expression object. I've not really used the regular expression object before and I'm finding it a bit clunky to use.
Basically I'm trying to match the 'description' within the string 'file_description_1'
However I'm unsure how to return the partial, would I use the Execute or Replace methods?
Regex looks like this:
With RegularExpressionObject .Pattern = "file_(.*?)_[0-9]" .IgnoreCase = False .Global = True End With
I've discovered an insidious bug with the VBScript Regular Expression object.I set the pattern to consist of the set of invalid filename characters plus comma. I set global property to true then do a replace on a SID. The Replace does nothing. However, if I attach the C++ (dev studio 2003) debugger to the IIS host process (dllhost.exe), every time I call RegExp.Replace, the stack for one of the process's threads gets scrambled. It ends up with the value 0x00000001 at the top of the stack! If your debugger is set to stop on access violations, it always catches one (invalid read trying to delete). The problem is insidious because, without the debugger running, you would never know this is happening. ASP returns no error. Potentially this could wreak havoc on your web application and cause bizarre failures later on. Has anyone else run into this one? It seems to happen only with the Replace method.
<textarea name="whatever">Here is some text area text</textarea>
I know the following pattern works:
<(select|textarea).*(.| )*?</(select|textarea)>
But the problem is my web hosting company is using ASP scripting engine 5.1 which does not support the non greedy delimiter (?). I doubt they are going to upgrade to 5.5 anytime soon.
I'll appreciate it if anyone can give me a pattern that does the same job but does not use the ? delimiter. Is there a way I can tweak the pattern above so that it works in ASP scripting engine 5.1?
I'm trying to work out a reg.exp. that will pick out a sql statement against a certain set of tables - in this case any table named "Survey~something~", but I only want to pull back those statements where the CompanyID column doesn't appear in the query. (The expression is being used in my editor so it might appear a little strange, but by and large it works the same as you'd expect.)