Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / January 2006



Tip: Looking for answers? Try searching our database.

What is escape key in access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bookreader - 30 Jan 2006 19:42 GMT
What is the excape key to use in VB so that I can pass to Access an
insert statement with an apostrophe in the value?

Example
Dim strInsert As String
strInsert "Insert into names (Client) VALUES ('Art's Market');

That apostrophe in Art's Market causes problems.

Thanks.
Jay Taplin - 30 Jan 2006 20:04 GMT
Double apostrophes...

strInsert = "Insert into names (Client) VALUES ('Art''s Market');

I use this routine in all of my apps where I use an actual SQL command
to INSERT.

   Public Function sWrap(Value As String) As String
       sWrap = "'" & Replace(Value, "'", "''") & "'"
   End Function
Bookreader - 30 Jan 2006 20:08 GMT
>Double apostrophes...
>
[quoted text clipped - 6 lines]
>        sWrap = "'" & Replace(Value, "'", "''") & "'"
>    End Function
Cool.

Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.