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?
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:
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 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"
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.
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:
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:
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:
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:
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
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?
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:
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:
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?
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:
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:
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.
'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])]))$
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.
i get the ref url that come to my site and i want to convert it to find out what was the query in (google or other searcher sites)
foe example : if someone goes to google and search some text and my site was in his resaults and he click on it , in my site i see his link ref like http://www.google.co.il/search?hl=i...91-Google&meta=
i want to know (in asp and save it to DB) what was the word or words that the user write in search engine.
I am trying to create a parametric search within a table (in the column headings). My first page (search.asp) allows you to choose parameters from a dropdown box, such as package and volts. You click "search" and it reads the Access dbase to yield the results.
The results page (results.asp) displays the information based on the parameters. Under the package column heading, I have the same drop down box, and I am able to once again choose the package I want and the table will refresh. Code:
I have list of songs in table in asp page. I would like to put a link to each song so when user click on one I can search database for it's data. How to do that?
i have a database with 5 tables, on my web site i have a search bar.. i wana link that search bar to my tables so.. when ever some 1 searchs for a product, the search bar shows that all the simmuler products to what they searchd for..
I have a search page that has ms frontpage database wizard results showing. The thing is, is that I want to have the search form on other pages besides my search.asp page. Does anybody know how to make a search form on a seperate page that submits the search to the database and displays the wizard results on the search page.
How could I try and make the most important result from a search show up on top? I was thinking of having a result where the strSearch is the most to the left come up on top but else then that vague and not necessarly effective option I have no idea on how to do this.
Intranet tech support system using ASP/VBScript running on W2000 Server, IIS, and using SQL Server 2000. I need to add a search engine. The problem with using a regular SQL query is that if you put a phrase, say "red car" in the text box, to hit submit, my SQL qurey would only look for that phrase, and would leave out other items where the words red and car appeared separately. I guess what I am saying is that I would like something like Google or other search engines, which would find results which seem to fit the criteria typed into the box, and rank them and highlight key words. My research so far has shown me that SQL Server has something called Full-Text searching, and I have tried to read up on that in BOL, but not really seeing how I can apply it. I wonder if there's already some tutorials or sample code out there. I have done some looking on the Web, but still haven't found much.
I have created an asp server page as described in the Microsoft Article 318387 HOW TO: Query Index Server Data by Using ASP in FrontPage 2002 (http://support.microsoft.com/?id=318387)
It is running off my IIS server for the search results. However, the results return only file locations; I would like it to return a link to the hits. How would I do this?
im now doin a search function... but my problem is... if i didn't enter any data in the textbox and then click search button, it will appear all list from database instead of display "please key in data".
I just want to display "please key in data" but not display all records. Code: