Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting HTML Tags (Multiple single quotes) 1

Status
Not open for further replies.

skispray

Programmer
Feb 28, 2003
16
US
I have a problem with my SQL Insert statement which is the single quotes.

INSERT INTO DOCS VALUES ('<a href= & filename2 & &quot; target=new_window>&quot; & txtTitle.Text & &quot;</a>','next value',....)

The problem is that if my filename2 is something like &quot;My File.xls&quot; then the link on my datagrid will read:

There needs to be single quotes before the &quot;http&quot; part and after the &quot;filename2&quot; part so my link will read the whole file name, not just until the space. It won't let me use more than one pair of single quotes per Value.

Any help would be much appreciated.

Thanks
 
You can &quot;escape&quot; the double quotes by putting two in a row wherever you need them:

Code:
strSQL = &quot;INSERT INTO docs VALUES('<a href=&quot;&quot;[URL unfurl="true"]http://www.myserver.com/docs/&quot;[/URL] & filename2 & &quot;&quot;&quot; target=&quot;&quot;new_window&quot;&quot;>&quot; & txtTitle.text & &quot;</a>', 'val2')&quot;
--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top