Current location: Hot Scripts Forums » Programming Languages » Visual Basic » using single quote


using single quote

Reply
  #1 (permalink)  
Old 12-05-03, 03:24 PM
nuchy nuchy is offline
New Member
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy using single quote

Hello All,

I want to have the single quote in my data field but I can't be insert into the table field. I tried many ways to use it by put '\', '&' and "" in front of single quote but it didn't work!
Help please!
Reply With Quote
  #2 (permalink)  
Old 12-06-03, 04:12 PM
Emmanuel Emmanuel is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Hi,

For example if you want only one single quote as value in your datafield, try one single quote between two double quote :

NameOfRecordset.fields("NameOfDataField").value = "'"

Note that in general, the string combinations are the same with a textbox object. You can put it one on your form to see the result before to use your code on a field database.
Reply With Quote
  #3 (permalink)  
Old 12-06-03, 05:25 PM
nuchy nuchy is offline
New Member
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
let me give you some of my example.
my data -> 7' wood stick
so, I want to have exactly like the data above for my database field.
I tried to do this
Mid(mystring, myposition) = "'", but it still didn't work.

Any Idea?

Thanks..

Quote:
Originally Posted by Emmanuel
Hi,

For example if you want only one single quote as value in your datafield, try one single quote between two double quote :

NameOfRecordset.fields("NameOfDataField").value = "'"

Note that in general, the string combinations are the same with a textbox object. You can put it one on your form to see the result before to use your code on a field database.
Reply With Quote
  #4 (permalink)  
Old 12-07-03, 09:44 AM
hoopaddict hoopaddict is offline
New Member
 
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Mid(mystring, myposition) = "'", but it still didn't work.
how about Mid(mystring, myposition) = chr(39)?
Reply With Quote
  #5 (permalink)  
Old 12-07-03, 03:51 PM
Emmanuel Emmanuel is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Hi all,


If you declare mystring as string or as a variant, it works and chr(39) too. Use a temporary string variable in mid expression and then assign the datafield value with it.
Reply With Quote
  #6 (permalink)  
Old 12-07-03, 04:32 PM
hyjacked hyjacked is offline
Wannabe Coder
 
Join Date: Nov 2003
Location: New Brunswick, Canada
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
have you tried 2 single quotes? for some reason I'm thinking that is how it is done.
__________________
hyjacked
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Hello World Antitrust PHP 10 10-14-03 01:27 PM
running dll script using single http call? Bahlool HTML/XHTML/XML 0 10-11-03 03:16 AM
Flatfile single Forum with Perl Gaz General HotScripts Site Discussion 1 08-07-03 04:37 AM
Single file security PersuT PHP 1 06-28-03 06:54 AM


All times are GMT -5. The time now is 01:17 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.