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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html tags within access database field update syntax 1

Status
Not open for further replies.

ssf

IS-IT--Management
Mar 18, 2002
3
0
0
GB
I am trying to update an Access database field with a hyperlink (text including html tags). I have created an sql string including this html text (which is held in a variable called new_document) : &quot;<a href = '\\ADONIS\ISO9001\QSLA-9998.mpp'>QSLA-9998</a>&quot;

the sql command looks like this:

sql = cstr(&quot; update Table1 set Title= '&quot; &Request.Form.Item(&quot;Title&quot;)& &quot;', Document= '&quot;& cstr(new_document) &&quot;' where level = '&quot; &Request.Form.Item(&quot;Level&quot;)& &quot;' and number = '&quot; &Request.Form.Item(&quot;Number&quot;)&&quot;'&quot;)


When I try to run the script, I get the following error.


Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''<a href = '\\ADONIS\ISO9001\QSLA-9998.mpp'>QSLA-9998</a>''.

Can anyone help how I can define a variable which is then included in an sql string that updates a hyperlink field in an Access database?

Thank you!

 
Try this:

new_document = &quot;<a href=\\ADONIS\ISO9001\QSLA-9998.mpp>QSLA-9998</a>&quot;

sql = &quot;update Table1 set Title= '&quot; & Request.Form.Item(&quot;Title&quot;) & &quot;', Document= '&quot; & new_document & &quot;' where level = '&quot; & Request.Form.Item(&quot;Level&quot;) & &quot;' and number = '&quot; & Request.Form.Item(&quot;Number&quot;) & &quot;'&quot;

Check your Number field too. Is it really a text field? It is the way you have it written.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top