I seem to end up with too many double quotes when using this clean up function.. either that or I am missing a display function when I display the details from the dB.
I only really wanted the microsoft ouble quote to become one set of double quote instead of double as I have here but I can't get away with anything less.
essentially when I input a � I get a "" when I only want ".
If I replace "a" with "b", and then I replace "b" with "a", shouldn't I get the same result? That is what I am trying to encode and decode with Replace() function, but it is giving me different things when I replace and replace again. Here is what I am talking about: Code:
I've tried EVERY way i can think of to do this replace function, basically when i go to insert "Do's and Dont's into the database it cuts it off at "Do" because of the ' now ill show you my section of code that i have it in currently:
I'm trying to use the replace function to change a variable ie like this:- replace folder_old, txtOldFoldername,folder_rename
folder_old = c:DocumentsRoot_Testob txtOldFoldername = bob folder_rename = newfoldername
all i want to do is to beable to change the name bob to the new folder, is there a easier way to do this or am I on the right track. if i do the replace like this replace(folder_old, " & txtOldFoldername & "," & folder_rename & ") i get this error:- Cannot use parentheses when calling a Sub
I need to replace several letters to different strings ,I need it in one variable .How can I do that?
If InStr(1,request.form("S8"),"A",1)>0 or InStr(1,request.form("S8"),"B",1)>0 or InStr(1,request.form("S8"),"C",1)>0 then
a=Replace(request.form("S8"),"A","You could use occasionally") b=Replace(request.form("S8"),"B","You could use often") c=Replace(request.form("S8"),"C","You would actively promote") End if
i am new to asp and i am having problems using the replace() function to replace occurrences of text in a string.basically what i want to do is replace any occurrences of a double quote (") in a string with "
the code i am using looks like this: set overview=replace(overview,"""",""")
but when i run load the page i get the following error: Microsoft VBScript runtime error '800a01a8' Object required: '[string: "A 13 year old girl p"]' /ASP/index.asp, line 58
did i get the syntax wrong? i figured that if i was looking for a single quote that i just had to put an escaped double quote "" inside of the quotes.
I am trying to make the user input form more secure and so I want to use this piece of code
[vbs]Replace(strInput, "'", "''")[/vbs] but my sql query (which already works) looks like this [vbs]insSQL = "insert into Details (ServiceName, Bor_ID, Address, Postcode, Tube, Rail, Bus, Parking, Tel, Fax, Minicom, Email, Contact, Opening, Eligibility, Access, OtherFacil, Special, Internet, Other, Cat_ID, URI_ID, Db_ID, Des_ID, Main_ID) values ('" & Request.Form("ServiceName") & "','" & Request.Form("Borough") & "','" & Request.Form("Address") & "','" & Request.Form("Postcode") & "','" ...[/vbs] How am I best to implement the code? I tried to do this [vbs]& Replace(Request.Form("ServiceName"), "'", "''") &[/vbs] in the actual sql query but I got this error [vbs]Data type mismatch in criteria expression. [/vbs]
I have searched so many "Replace" function topics, but there is something that I don't understand....I found some like this... Replace(strField, " ' ", " ' ' ") .... do anyone knows what's the use of replacing ' with ' ' ?
this allows me to display raw code on a page that is entered into an Access memo field. Trouble is it all comes out in one line, so i tried adding a [VBS]VbClRf, "<BR>"[/VBS] to it and am getting string errors. Ive tried a few variations and it's really bugging me.
i have stuffed some comment from database within teaxtarea, problem is text are displaying as cobination of data and html tag like <br> (data and <br>) like as follows this is the first line means<br> this is the second line. i wrote replace code as comment=replace(comment,vbcrlf,"<br>") while adding this comment to database. how could i come out from this problem.
I have the above code... is the bit where I am replacing "../" valid or can I get rid of the "&"? Can't test it at the moment so that's why I am asking here.
Can the replace() function in asp be used on an excel spreadsheet? I can't seem to find out anywhere, and I can't just test and see because my connection string keeps throwing Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x664 Thread 0x19b8 DBC 0xebb6e6c Excel' . (but thats another story/future post perhaps ) I pretty much just need to know if replace() will work.
Does anyone know of a function (preferably already made) that would replace a string starting from it's start position to it's end position with a specific string...
I use a replace char function to remove any bad words from user's input to prevent SQL injection. Here is what I use:
Function killChars(strWords) Dim badChars, newChars badChars = Array("bad words here") newChars = strwords For i=0 to uBound(badChars) newChars = replace(newChars, badChars(i), "") next killChars=newChars End function
Now the problem is if a user enter "DeLETe" in the input box, and this word is not get removed before entering the DB. because I entered "delete" in the badchars array.
so how can I enable a case sensitive in my function? So the bad words would get deleted regardless its in upper or lower case?
i need to retrive record form database for a particular DATE and particular name i have to pass date and name thro "form" then i have to display that particular record . how to proceed.
In the ASP page that is in question, I build a large string (no more than 10K) which is basically an email template in HTML format. Then I replace the parts with the values, which are also strings with the size of 1-2 KB. Code:
I need to insert field data with apostrophes into Access. However, I keep getting "object expected" errors when I post. I heard about using the replace function like this:
var incidentlocation = Replace(Request.Form("incidentlocation"), "'", "''");
but I get the "object expected" error. What I am doing wrong? My code is below in the text file.
I have a simple form submission but the problem is my SQL insert (or update) is failing if in the text field there is any single quotes (') I tried running the like replace(textfield,"'","") to just remove them but it will still error out on me. is there any other way to format the variable, do I need to use an escape character?
Is it possible to grab stock quotes (with of course the 15min delay!!) and place within an ASP page?written in ASP.it is possible to read HTML content on webpages without outputting them and then using the values etc
I'm trying to make a dynamic table where on the left side items are placed and on the right side the item clicked is shown. For an example look at www.uitdagen.nl uitgaan->cafes
This all works fine except when I use a ' or a newline a error is generated because in dhtml a ' is used to open and close a string. When i use a ' in the string it goes wrong because i already close the string in the string.
If already tried to use chr(39) etc. But this won't work because this still will generate a ' for the dhtml.
Running into a what I thought should be a small problem but it's going on an hour and I still can't figure it out
Reading an excel file and running queries on Sheet names. The problem is when there is a single quote in the sheet name.
selectQuery = "SELECT * FROM Dave's Sheet"
I tried to use
selectQuery = "SELECT * FROM Dave's Sheet"
But that doesn't work either.
It keeps bombing the query. Not matter what I try I can't get this to work. I can't replace the single quotes because then it can't find the tab name. Any ideas?
how i could insert data into my DB that contained apostrophes. for example, I wanted to insert Bailey's well, my SQL statement was being cut off when it hit the ' and i was getting all sorts of errors. i was writting some complex stuff to take out the ' then re-insert it when being displayed.lots of work then i thought, what if i replace my ' with " in my insert statement.
like i said, some of you may know this, but i thought id share my experience with you just in case someone runs across the same problem.
I am writing an asp app for generating quotes. What I would like to do is allow the user to edit the quote lines without having to open a new page each line.
On the quote I have created a loop which goes through the recordset and populates a sort of data grid. Can you use javascript or something so the user can click an edit icon on the appropriate line item in the grid and edit the line details there instead of having to open another page to edit the line item.
Select * from MATABLE WHERE title = '"&myvariable&"' ORDER BY title
so some of my title have single quote/apostrophe in them, ex: Don't know me . so when I tried to access those article with that kind of title I get the error message Missing operator. So is there a way to have my title be all right? a function maybe?