Only Constants, Expressions, Or Variables Allowed ..
Getting this error:
The name 'squibble' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
/squibble/incFunc.asp, line 13
when trying the following:
Code: ....
View Replies
ADVERTISEMENT
I have the following problem.
I'm building a site with a db backbone.
In an "include file" I set a constant like:
Const partners = 22
and on some other page, I want to pass the word partners using the query string.
Meaning: I want to make such a link:
href="mypage.asp?module=partners"
When my page reads the querystring - I want it to be able to understand the value of the constant "partners".
when I read from the db using the following kind of Query, I get a "no value specified for one of more..." Code:
View Replies
View Related
I'm trying to transfer an intranet app from one server to another. I'm
having a problem with the ADO constants on the destination server.
Our intranet site runs on the server.
In a virtual directory, I have a seperate application that is accessible
from the intranet.
I have the following in the global.asa in the virtual directory:
<!--METADATA TYPE="typelib"
UUID="2A75196C-D9EB-4129-B803-931327F72D5C"
NAME="Microsoft ActiveX Data Objects 2.8 Library"-->
This usually allows me to refer to the ADO constants, e.g.
Set rsLoc = oConn.Execute (sSQL, iAffected, adCmdText)
However, in this case, IIS is complaining... Variable is undefined:
'adCmdText'
This is a new (clean) server, so I'm wondering if there is some kind of
confirguration issue..
View Replies
View Related
I'm relatively new to coding activex and I have a problem. I've written an activex component in c++ and I am now using asp/vb pages to access the object. Is it possible to access constants that I've defined in the activex object? For example, can I do something like the following:
Dim constantValue
Set activeX = CreateObject("MyObject.MyClass.1")
constantValue = activeX.MY_CONSTANT_VALUE
View Replies
View Related
Is it possible that both adUseClient and adLockOptimistic does not really work with ASP ?When I use 3 for both - it does.
View Replies
View Related
I realize that this isn't a VBS newsgroup, but it's the only Microsoft newsgroup I read regularly so I hope that you'll be gentle with me. Where is the constant "vbCrLf" defined? My computer has been searching its hard drive for about three hours, now, looking for a definition and it still hasn't found anything.
The reason I'd like to find vbCrLf is because I wonder what else is in there. Is there a vbTab? vbBackspace?
View Replies
View Related
I want to get the Structure within the 2 HTML Tags. I am not able to Get the regular expression for it. So here is the Code and could anyone give m ethe regular expression to get the HTML tags between the Code:
View Replies
View Related
how to use Regular Expressions in ASP .
View Replies
View Related
Im trying to replace all occurences of a newline with a <br /> tag using regular expressions.
However, I only want to replace the newline with a <br /> tag if the newline does NOT come directly after an </h2> tag.
I cant seem to work out a regular expression to do this. So, for example.
This is an example line. You can see how it would work. would create
This is an example line.<br /><br />You can see how it would work.
and
<h2>The Heading</h2>
This is an example line.
You can see how it would work.
would create
<h2>The Heading</h2>This is an example line.<br /><br />You can see how it would work.
View Replies
View Related
I've been searching for a complete listing of the CDO constants, but have
come up empty. Where can I find a listing of all the CDO named constants
that can be referenced directly with the CDO metadata typelib, i.e.,
<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->
View Replies
View Related
I have been trying to run the example listed on MSDN to test a regular
expression. I'm running a win2k3 web server edition, WSH is version5.6.
I am getting an error everytime I run
Set RegEx = New RegExp
I have seen a few problems on MSDN with users not getting the right
permissions for some dll's so I went through the procedures trying to
correct that. I've seen the RegExp values in the registry. Even had a
friend of mine try the script on his machine. (mind you this comes
directly from MS) I cannot get New RegExp to work at all
View Replies
View Related
I've got a page of text which I am assigning to a string. Within this
page there are special tags e.g. lots of text....<ti>dogs</ti>..lots
more text....<ti>this is a cat</ti> etc.. So I've got a long string
interspersed with these tags. Now what I need to do is get a list of
the words/phrases that are within these tags. So in my list I would
get dogs, this is a cat etc..
I've tried a combination of mid, instr and replace and got it sort of
working but there's got to be a more efficient way of doing it.
Possibly using regular expressions?
View Replies
View Related
I've been trying to create read-only global variables by creating constants (Const) in my global.asa, but I can't seem to reference them. Sticking them in an include works fine, but it seems more structurally sound to use Application_OnStart. Am I attempting the impossible, and if so, why?
View Replies
View Related
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
Can I use regexps in fso.DeleteFile? I've found I can use a '?' and probably a '*' (although that seems a tad brutal) but I'm having trouble with expressions like ([a-z]|[0-9]-).
Am I wasting my time trying to get it to work (i.e. does it support them?) If so, how do I use them? Does it have its own quirky syntax or "standard" regexp? Every example I've found so far just mentions deleting something simple like *.txt.
For the record, I need to "tidy up" a directory full of images by deleting files whose names _don't_ contain particular text. It's quite convoluted and would be far easier if I could just go through each file one by one but hey. Here are the details:
1) I have a list of IDs in an array that I've read from a data source. This is the "current ID" list
2) I have a list of image filenames from a directory in another array. The image filenames contain an ID in them. There could be none, one or more images containing the same ID.
3) I look at each file in turn, extract the ID portion and add it to an array of "found" IDs - crucially, this array is only updated if the ID has not been seen before in another filename
4) I then step through this array and use Filter() to see if the ID is in the "current ID" list somewhere
5) If it is missing from the list, that ID is deemed "out of date" and all associated images containing that ID need to be deleted. Message to screen saying that ID has been deleted.
6) If it is in the list, just print a message saying it is "current" and move on.
I realise I could just step through each file and test it against the current ID list but then the output on-screen would be file-by-file and not ID-by-ID. The client doesn't care how many files there are; they don't even care about the underlying structure - they just point the browser to my script and it deletes the files, shows them which IDs have been removed and tells them how many IDs in total have been deleted.
If I went down that route I would have to keep a record of which IDs I've deleted and output the lot at the end instead of 1 by 1 as I go, which leaves the browser hanging for a while and doesn't give the client reassuring feedback as it ploughs through the directory adding the results to the screen row by row. Code:
View Replies
View Related
I know the basic 8, how do i find any others besides those 8? do you use hex codes? should also note that i need to be able to match the vbcolor to a hex color.
View Replies
View Related
Is it possible to server.execute a file that has a list of constants and then use those constants? I've tried, but the asp tells me the the variable is undeclared when I try to <%=const_name%>
View Replies
View Related
In an Oracle 8.1.7. Database there's a package like this:
PACKAGE CONSTANTS
C1 CONSTANT NUMBER := -1;
END PACKAGE;
How do I reach CONSTANTS.C1 from ASP?
I have tried
SELECT CONSTANTS.C1 FROM DUAL;
but it didn't work even when run in the database console.
View Replies
View Related
Can I use server.execute to get constant values ?
View Replies
View Related
Problem: I want to check the data from a RecordSet.GetString result for today's date. If today's date exists in the row then I want to replace the preceeding <tr> tag with a <tr style='background:grey'>. I made the following objRegExp.Pattern:
.Pattern= "<tr><td><font size='1'>[w]*</font></td><td><font size='1'>[w]*</font></td><td><font size='1'>" & FormatDateTime(now(),vbShortDate)
This successfully identifies the row as containing today's date. Yea! Now, the replace part.
text = objRegExp.Replace(text,"<tr style='background:grey'><td><font size='1'></font></td><td><font size='1'></font></td><td><font size='1'>" & FormatDateTime(now(),vbShortDate))
This piece works except I lose the data that was actually contained in each cell. How can I have it so that the only thing that gets replaced is the table row tag?
View Replies
View Related
I am working on an ASP page that parses text using the VBScript.RegExp
regular expression object. My reg expression right now is as follows:
[a-z]+.[a-z]+.[a-z]+/
And if find URL's no problem like: windowsupdate.microsoft.com,
www.cnn.com, etc.
But I need to also find any URL, like these:
www.amazon.com/books/atoz/index.html
OR
msdn.microsoft.com/newsgroups/default.aspx
Some URL with a deeper path than something.something.com if that makes
sense. Any ideas?
View Replies
View Related
What regular expression would I use to take out all of the money (US amounts) from a string?
Right now I have:
Code:
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "$(.*)"
.IgnoreCase = True
.Global = True
End With
xmlText = RegularExpressionObject.Replace(xmlText,"")
Set RegularExpressionObject = Nothing
which obeously doesn't work. What should I use for:
.Pattern = "$(.*)"
??
View Replies
View Related
I have created a template system, and someone pointed a script out that would let me create simple links by using [link]home|http://www.sitepoint.com[/link] which would convert anything between those custom tags into a link, with home being the text displayed and the web address the location.
Now I need a way to be able to edit the script, well the RE Pattern so I can use it for other things. Code:
View Replies
View Related
I need to process a string to do some data insertion into a database table.
However, this string contains some constant variables (set in the include file) and it depends on the value of intDataCtr as below : Code:
View Replies
View Related
I have a problem. Of course, or I wouldn't be posting here. Ok, now that Mr. Obvious is out of the way ...
I'm looking for some ideas. Take a look at the code below. I'm looking for the most efficient way to validate form field input on the server-side. I'll provide what I have. What I'm looking for are improvements.
<%
Function Validate_Input(Expression,Pattern)
Dim objRegExp
if Expression <> "" and Pattern <> "" then
Set objRegExp = New RegExp
select case (Pattern)
case "US_PHONE"
' sample matches: 1-(123)-123-1234 / 123 123 1234 / 1-800-ALPHNUM
' sample non-matches: 1.123.123.1234 / (123)-1234-123 / 123-1234
objRegExp.Pattern= "^([0-9]( |-)?)?((?[0-9]{3})?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$"
case "US_DATE"
' sample matches: 02/29/2084 / 01/31/2000 / 11/30/2000
' sample non-matches: 02/29/2083 / 11/31/2000 / 01/32/2000
objRegExp.Pattern= "(((0[13578]|10|12)([-./])(0[1-9]|[12][0-9]|3[01])([-./])(d{4}))|((0[469]|11)([-./])([0][1-9]|[12][0-9]|30)([-./])(d{4}))|((2)([-./])(0[1-9]|1[0-9]|2[0-8])([-./])(d{4}))|((2)(.|-|/)(29)([-./])([02468][048]00))|((2)([-./])(29)([-./])([13579][26]00))|((2)([-./])(29)([-./])([0-9][0-9][0][48]))|((2)([-./])(29)([-./])([0-9][0-9][2468][048]))|((2)([-./])(29)([-./])([0-9][0-9][13579][26])))"
case "EMAIL_ADDRESS"
' sample matches: asmith@mactec.com / foo12@foo.edu / bob.smith@foo.tv
' sample non-matches: joe / @foo.com / a@a
objRegExp.Pattern= "^([a-zA-Z0-9_-.47]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,7}|[0-9]{1,3})(]?)$"
'The next line is supposed to be an RFC 2822 address compliant validation expression
'objRegExp.Pattern= "^(?:[w!#$\%&'*+-/=?^`{|}~]+.)*[w!#$\%&'*+-/=?^`{|}~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-](?!.)){0,61}[a-zA-Z0-9]?.)+[a-zA-Z0-9](?:[a-zA-Z0-9-](?!$)){0,61}[a-zA-Z0-9]?)|(?:[(?:(?:[01]?d{1,2}|2[0-4]d|25[0-5]).){3}(?:[01]?d{1,2}|2[0-4]d|25[0-5])]))$
case "ZIP"
' sample matches: 78754 / 78754-1234 / G3H 6A3
' sample non-matches: 78754-12aA / 7875A / g3h6a3
objRegExp.Pattern= "^(d{5}-d{4}|d{5})$|^([a-zA-Z]d[a-zA-Z] d[a-zA-Z]d)$"
case "CREDIT_CARD"
' sample matches: 6011-1111-1111-1111 / 5423-1111-1111-1111 / 341111111111111
' sample non-matches: 4111-111-111-111 / 3411-1111-1111-111 / Visa
objRegExp.Pattern= "^((4d{3})|(5[1-5]d{2})|(6011))-?d{4}-?d{4}-?d{4}|3[4,7]d{13}$"
case "NAME"
' sample matches: T.F. Johnson / John O'Neil / Mary-Kate Johnson
' sample non-matches: sam_johnson / Joe--Bob Jones / dfjsd0rd
objRegExp.Pattern= "^[a-zA-Z]+(([',.- ][a-zA-Z ])?[a-zA-Z]*)*$"
case "ADDRESS"
' sample matches: 2222 Mock St. / 1 A St. / 555-1212
' sample non-matches: [A Street] / (3 A St.) / {34 C Ave.}
objRegExp.Pattern= "^[a-zA-Z0-9s.-]+$"
case "CURRENCY"
' sample matches: $3,023,123.34 / 9,876,453 / 123456.78
' sample non-matches: 4,33,234.34 / $1.234 / abc
objRegExp.Pattern= "^$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$"
case else
Response.Write("Invalid syntax used to call form validation function.")
Response.End
end select
Validate_Input = objRegExp.Test(Expression)
else
Response.Write("Invalid syntax used to call form validation function.")
Response.End
end if
End Function
' Get data from the form collection and assign to variables
dim str_Customer_Email
dim str_Customer_Phone
dim str_Customer_Name
dim str_Customer_Zip
str_Customer_Email= Request.Form("email")
str_Customer_Phone= Request.Form("phone")
str_Customer_Name= Request.Form("name")
str_Customer_Zip= Request.Form("zip")
if not (Validate_Input(str_Customer_Email,"EMAIL_ADDRESS")) then response.write ("error")
if not (Validate_Input(str_Customer_Phone,"US_PHONE")) then response.write ("error")
if not (Validate_Input(str_Customer_Name,"NAME")) then response.write ("error")
if not (Validate_Input(str_Customer_Zip,"ZIP")) then response.write ("error")
response.end
%>
Now, I'll obviously want to do more than write "error" to the screen with the validated input. What I *really* want ideas on is a more efficient way to validate the fields. In this small example doing them as one-offs isn't bad. On a form that has 20-30 fields it becomes cumbersome.
View Replies
View Related
I need to strip some text from between two strings, my code looks like this:
SECTION = "My page name"
I need to build a regular expression that will return:
My page name Anyone know how to do this?
View Replies
View Related
I've created a web application with Visual Interdev and I've added Microsoft
XML, version 4 in project's references. A META tag has been successfully added
in global.asa:
<!--METADATA TYPE="TypeLib" NAME="Microsoft XML, v4.0"
UUID="{F5078F18-C551-11D3-89B9-0000F81FE221}" VERSION="4.0"-->
But when I write the following code in an ASP server-side javascript:
<p>Value: <% = SOMITEM_ELEMENT %></p>
I get a Microsoft VBScript error '800a01f4'. Undefined variable:
'SOMITEM_ELEMENT'
I don't get such an error with ADO constants (even though I didn't include
ADOJS.inc). Can someone tell me what's wrong?
View Replies
View Related
I need to create a asp page with fields like FirstName, LastName etc.
But this 2 fields only allow the user to enter english characters, no
chinese, no jap.. nothing else..
What is there that i must do to disable users from entering character other
then English??
View Replies
View Related
Method Not Allowed
The requested method POST is not allowed for the URL /Database/processForm.asp.
Apache/1.3.33 Server at antonyx.freestarthost.com Port 80
i just got this error, however, i have managed to post data into my database on this server b4, why is this error comin up now, could there be a prob with my asp file??
View Replies
View Related
I'm using Shadow's upload script. whenever i try to upload a file larger than a few hundred kilobytes, i get this error: "operation not allowed; /_uploader.asp, line 56" at the top of _uploader.asp, i have changed the maximum file size to 50 mb. this is line 56 on uploader.asp:
View Replies
View Related
I would like to create a list of characters, and what to replace them with before inserting them into a database. So far, I know of the sigle quote, and you just replace it with two single quotes (' to ''). Are there any other ones that you guys are aware of?
View Replies
View Related
I've got a page that users of my website are sent to when they log in, and one part of it shows their friends (think myspace). The page works fine if the user has one friend, but it seems that if they have more than one then i get the "Operation not allowed" error.
I won't post the whole page because there's about 750 lines of it, but here's the code that gets the friends images from a mysql db and then shrinks them (if necessary) and puts each image into a table (for a tidy layout):
NOTE: "sql" is in case there is more than one users image to get, i've checked the query when there is more than one user image to get and it looks fine... Code:
View Replies
View Related
I have created a form using post which directs to a psmail.asp page. i keep getting the following when submitting the form. Can anyone suggest what i may have done wrong?
Error 405 Method Not Allowed
The requested method POST is not allowed for URL /html/psmail.asp
Powered by Zeus Technology
i dont understand why it is not allowed.
View Replies
View Related