Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm updating and inserting text/string data, using SQL. I know that when I use quotation marks " I have to double them up.

 

My problem is, I'm getting data from one table, and updating another (or inserting), I run through:

 

string.replace( chr(34),chr(34)&(chr34) )

 

and sometimes it literally writes the double quotes to the table. Naturally when I go to read that data back again, it has extra quotation marks where I dont want them.

www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
  • Moderators
Posted

When you say "getting data from one table, and updating another"...

 

Are you doing this in a SQL statement or is it being processed through your code? The Replace() leads me to believe the latter.

 

I would surround strings with single quotes, and when a single quote does need to be saved in the table then you can double-up on the single quotes.

Visit...Bassic Software
Posted

Ok - I figured out I was a little confused. I found out I DON'T need to double up on the double quote: "

 

I DO need to double up on single quotes wherever sending SQL queries. This way the dbase driver can tell when it should store the field, or treat it as text like any other.

 

I was simply confusing single quotes and double quotes. Thanks for advice.

www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...