Querying Single Quote
I have a rather basic question. I have a simple username and password front end that queries a SQL database, I run into problems when one of the user names has a single quote in it (IE: O'brian).
I get the "Microsoft OLE DB Provider for SQL Server error '80040e14' Line 1: Incorrect syntax near 'brian'." error message, any clues on how to display those particular cases? is there anything in particular that should be done to my SQL statement?
View Replies
ADVERTISEMENT
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?
View Replies
View Related
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?
View Replies
View Related
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.
View Replies
View Related
I am having a problem with a single quote in my URL. I use HTMLEncode and all is good on my machine, but when I test it with a browser from a different machine, I get 403 on invalid characters. More, it seems to me that the URL gets truncated after that single quote that I have in my URL.
View Replies
View Related
I'm trying to produce an image with a javascript link. The problem seems to
be with the single quote. Here is the code that I wrote:
response.Write("<a href='javascript:PopUp('http://www.yahoo.com')'><img src='image1.jpg' width='50' height='67'></a>")
When I preview the page and roll over the image, the link is truncated to just javascript:PopUp( .
I've tried creating the link with a string like below.
strLink = "javascript:PopUp(" & " ' " & "http://www.yahoo.com" & " ' " & ")"
The string displayed properly when printed on screen, but when I tried to use it as the link it truncated again. I'm not real sure what to try next.
View Replies
View Related
I have a code that goes to the url of the company.My problem is that if a company name has a single quote in it,it tries to end the statement.I tried a replace as you will see,but still doesn't work.Heres my code:
Response.Write "<td><center><a href='edit.asp?company="
Response.Write server.URLEncode(replace(rs("Company"),"'","'"))
Response.Write "'>Edit</a></center></td>"
View Replies
View Related
i want to place single quote in customer name. how?
View Replies
View Related
Where would i put this code:
replace(fieldToInsert, "'", "''")
to solve the problem of inserting these types of illegal characters into the database.
Heres the code which i need it to be in:
Code:
View Replies
View Related
I have a asp page where part of the code is as follows. This builds up the sql statement partially.
sql01 = "UPDATE EquipmentTbl SET "
sql01 = sql01 & "SerialNumber = '" & request.form(strSerialNum) & "', "
sql01 = sql01 & "Description = '" & request.form(strDesc) & "', "
sql01 = sql01 & "Location = '" & request.form(strLoc) & "', "
RESULT OF PARTIAL UPDATE STATEMENT USING RESPONSE.WRITE IS:
UPDATE EquipmentTbl SET SerialNumber = 'A83737', Description = 'Video
Conferencing Equipment', Location = 'Conference Rooms cabinet',
Now, in the above, I would like to be able to put the location field as 'Don's room'. In other words, I would like to handle the aprostrophe after Don. With this in mind I am changing the code as following: Code:
View Replies
View Related
I created an ordering system using DMWMX 2004, and Access DB. On one page I have an insert form and below a display table that shows their orders and calculates dynamically the value of those orders.
As is right now, the display table show orders for 7 days, but It doesn't discriminate what 7 days. I want to be able to display only orders from monday to Sunday until 5pm.
View Replies
View Related
how to locate the first record...i sorted the numbers and i want to display the first record based from the query...
View Replies
View Related
I have a database with 2 tables in it.
Each table contains the fields: ID(autonumber),Title, Artist, Description, DiscNo, and TrackNo. The second of the two contains an additional field: Price.
How would I make an asp page in which a person enters DiscNo and Price into a form and the code would read all the fields of that record from table1 and then add those and the Price into table2?
View Replies
View Related
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
View Replies
View Related
I have a recordset that pulls a list of products that a customer has purchased within the past year to date.
Now I need to sum up the total quantity by month that the customer purchased during that time period and dump all of that info into an html table. I am wondering if it's possible to query the first recordset instead of creating a new nested recordset.
View Replies
View Related
Given if tables A and B are in the same database, writing a query for them is relatively easy. But what if tables A and B are in different databases? Is it possible to query them together? If so, can anyone provide a generic example?
View Replies
View Related
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.
View Replies
View Related
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.
View Replies
View Related
I have this simple Select:
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?
View Replies
View Related
I'm having trouble retrieving one field from a table. Bascially i have two asp pages. On one u select a company field this then loads another page that finds the company details and posts it back to the first page etc.
Problem: The address field has line returns in it. When there aren't line returns it works perfectly otherwise it comes back with 'unterminated string error'.
In query analyzer my query works and i can use replace or update statements to remove
them in query analyzer however when i try that in an asp page it doesn't work.
View Replies
View Related
I'm building a path making tool, that is i have a network of paths for a park and each section of the path is its own image.
What i need to do is, when a certain piece of the path is clicked, it querys my path database and returns the information for that section of the path to a table.
Im designing in ASP VBscript and database is connected n all but im a beginner, is it feasable?
As well as this i need to be able to add to the table each time a piece of path is clicked, and also take away, like a stack.
AND aswell as this i need a seperate table which adds up the length of all the paths selected (length is in the database).
View Replies
View Related
I am working on building an asp forum, (I have posted a few times with questions ) and it works for the most part now, but I am trying to fix some things.
I am storing posts in a memo field. Originally it was text fields, but 255 characters is just not good enough.
Now, posts are saved fine except for 2 things:
1/ " and ' cause errors. These are causing conflicts with my INSERT SQL statement that is made. How would you get around this problem, I wonder?
2/ New lines etc are not being put into the memi field. I can live without this for the time being, but at some point I will want to implement posts being outputted in the same format they were inputted. Any advice on how to deal with this issue?
View Replies
View Related
just wondering if this is possible. i have a page where option boxes are dynamically generated. each time they change the form is submitted, so that it can populate another option box.
these are both database driven, and i was hoping that i could query the information from the database first and then load that into an array/record source. my next task would be to have that array/record source be passed once the page is submitted so that i can use the information again without re-querying the database. (its an efficiency thing) is that even possible? if not what other options do i have?
View Replies
View Related
I am having trouble getting the 's and +s on this statement correct. The first select line works as it is supposed to but the 2nd one does not. Can anyone correct this and perhaps tell me/point me in the direction of the rule of thumb for stuff like this?
Code:
<SELECT size="1" name="waste" onChange="window.location='drumsnew.asp?waste='+this.value+' &c_type=<%=Selected_Container_Type%>'+'&c_size=<%=Selected_Container_Size%>';">
<SELECT size="1" name="ctype" onChange="window.location='drumsnew.asp?waste='<%Selected_Waste_Type%>'+'&c_type='+this.value+'&c_size=<%
=Selected_Container_Size%>';">
View Replies
View Related
I want to query multiple tables (all with exactly the same field names) and then display the records returned in date order.
I've written the SQL to query all the tables (they start with the same name, but end with sequential numbers), but it's returning no records when I know there should be some. Any ideas? Code:
View Replies
View Related
I�ve got 2 recordsets, 1 called �special� and the other called �A55�
Special has a field called �Email_Address��.
A55� also has a field called �Email_Address��.
What I need to do is display all of the records in the recordset �A55� but only the records where the email address field is in the "special" recordset I am using ASP so is the solutions ASP or SQL and how is it done..
View Replies
View Related
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.
My function
Code:
Function CleanFormFields(FieldString)
FieldString = Replace(FieldString, "�", "'")
FieldString = Replace(FieldString, "�", """""")
FieldString = Replace(FieldString, "�", """""")
FieldString = Replace(FieldString,"""","""""")
FieldString = Replace(FieldString, "'", "''")
FieldString = Trim(FieldString)
CleanFormFields = FieldString
End Function
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 ".
View Replies
View Related
I have a small (still) SQL database, which I am trying to query from an ASP
page.
The field I am querying is of DATETIME data type, and is populated
automatically using the GetDate() function as a default value.
When I try and search on this field, using a date/time in the format
dd/mm/yyyy hh:mm:ss as the search criteria, it fails with the following
error:
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data
type to a datetime data type resulted in an out-of-range datetime value.
Can anyone tell me why this is? Surely if I am passing a value in the
correct format for the data stored in the field it should work? Or am I
missing something.
View Replies
View Related
Would anyone have a way to access certain Exchange public folders that
contain news group emails, perform a query on the folders for keywords and
return a list of those emails?
Basically, I've been asked to put a simple
single field on a web page that will query a list of exchange public folders
and return a list of those emails that have a key word match.
sort of like the MS Index server does on folders with files where one has an
asp interface to query the index data base.
View Replies
View Related
Does anyone have any functions to start a connection to the database and to query a database instead of typing it all over.
I am new to asp and i got a few days to learn it to get started on my sch project. I have the php database abstarction class, wondering is there any for asp and how do i go abt using it?
View Replies
View Related
Is there any way to quiry two tables in one select command to limit the number of database connections. One quire displays members from a members list the other quires achievments for each member. i.e.
select name, memberno from memberlist
then select * from achievements where member = memberno
currently this is done by a loop which requires lots of connections
View Replies
View Related
If rs("MyString") is Hello "Jim" Lad
<input type=text value="<%=rs("MyString")%>">
prints as <input type=text value=" Hello "Jim" Lad">
How can I get double quotes to display in a text box or textarea? Using a backslash or &Quot; (with Replace() e.g.) just prints out the backslash or &Quot;
View Replies
View Related
Here's the line I need to insert into an ASP page.
<script Language="JavaScript" src="/blarg.js"></script></head>
Right now it throws off the asp include with the quotes.
View Replies
View Related