473,394 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

asp quotes reading from database

229 100+
Hi, I have a size field where the input is in quotes like 20" x 20"
It writes to the database as I see the correct output in the webpage but when I open the record to update it it removes the quotes and I just get the first digets.
I have tried
Expand|Select|Wrap|Line Numbers
  1. imagesize= Replace(imagesize, "'", "''")
but that only replaces ' with "
I have looked around but cannot see the right solution. If anyone has the answer that would be great. Might it be that the access database field at the moment is set to text and amybe it should be memo or number?
Richard
Mar 1 '09 #1
4 2104
If you field types were set to number, your insert and updates would fail on datatypes. Text/Memo should work here(be a while since I worked with Jet).

Can you show us what a field value in the database looks like? If you are able to store 20"x20" in the field, then this should just be a matter of correctly using the replace function.

And can you define for us what you mean by opening the record to update it? Are you going directly into the table via Access, or querying a recordset and updating the record via the recordset?


Regards,
Jenkins
Mar 1 '09 #2
fran7
229 100+
Thanks for replying Jenkins,
I have memo in the database and I have opened my database to check that it writes the "" to it and it does, Its when I view through a recordset (a control panel) the "" get removed. Trouble is as they dont show in the form field when I update they get overwritten by the data without them.
I have this where I view the database contents

Expand|Select|Wrap|Line Numbers
  1. 'set database connection
  2. Set conn=Server.CreateObject("ADODB.Connection") 
  3. conn.Mode = 3      '3 = adModeReadWrite
  4. conn.Open ConnectString
  5.  
  6. Set rsCat=conn.Execute("Select categoryName,CategoryID From tblCategories Order By categoryName ASC")
  7. strTask="Insert"
  8. lngCategoryID=0
  9.  
  10.  
  11. If Request("artistID") <> ""  Then
  12.     strSQL="Select * From tblartists Where artistID=" & Clng(Request("artistID"))
  13.     Set rsart=conn.Execute(strSQL)
  14.     lngCategoryID=rsart("CategoryID")
  15.     imagetitle=rsart("imagetitle")
  16.     imagemedium=rsart("imagemedium")
  17.     imageprice=rsart("imageprice")
  18.     imagesize=rsart("imagesize")
  19.     imageyear=rsart("imageyear")
  20.     pictureurl=rsart("pictureurl")
  21.     additional=rsart("additional")
  22.     pay=rsart("pay")
  23.     pagetitle=rsart("pagetitle")
  24.     pagedescription=rsart("pagedescription")
  25.  
  26.  
  27. Set rsart=Nothing
  28. strTask="Update"
  29. Else
  30.  
  31. End If 
whatever I put in the field works fine its just the "text" that dont work.

20"x20" gives me 20
20x20" gives me 20x20
its obviously cutting the text from the last "
It seems to be a common problem. In my case its just a question of getting to see the "" in my select query.
If you have any ideas thanks
Richard
Mar 1 '09 #3
fran7
229 100+
Hi, I actually found the problem was not to do with the asp but the form field. I changed the field to a text area from a input type="text" and it worked. I am not sure if there is a problem with text areas and the ", but it seems to work now.
Thanks
Richard
Mar 1 '09 #4
jhardman
3,406 Expert 2GB
@fran7
That's what I was going to suggest. You can display quote marks just fine in a text area, but to do the same in a text input you would need to convert it to [ampersand]#34; or [ampersand]quot;

Jared
Mar 2 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: lawrence | last post by:
A user writes this sentence: "It was the New Urbanist's nightmare of sprawl run amok." They input that and my PHP script hits it with addslashes() and then the sentence gets put in the database....
4
by: Dave Moore | last post by:
Hi All, Can anybody point me to a FAQ or similar that describes what all this stuff is about please?. I'm interfacing with a MySQL database if that's relavent. I've read a couple of books which...
18
by: Colin Steadman | last post by:
My ASP page allows user to enter comments into a form. To avoid errors I'm having to strip out double quotes before saving to the database. Is there anyway to encode these so that I can store...
24
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the query to insert the string with the double...
3
by: Solution Seeker | last post by:
I want to Store the String value with Single Quotes in the Field of Database where if i try to Store the String value with Single Quotes (as it is) then it is throwing the error as SQL String...
4
by: Justin Fancy | last post by:
Hi everyone, I need to replace all instances of a double quote(") with two single quotes('') in a text file. I already have some replacements of strings going on, but I tried this one, but the...
2
by: Sheldon | last post by:
I'm using DoCmd.TransferText acImportDelim... to import a tab-delimited ..txt file using an Import Specification file and that works fine. The problem is that a few records could have...
7
by: nick.bonadies | last post by:
I'm trying to deal with user inputs of single quotes into form fields that get input into a MSSQL database. So far I have discovered that if I turn on magic_quotes_sybase in my php.ini file PHP...
14
by: adam.timberlake | last post by:
This is a really basic question for all you people out there who know PHP. This is not a problem but just something I'm confused about. I was reading the article below and wondered why are normal...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.