Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problem with Quotes in insert staement

New Here ,
Mar 06, 2007 Mar 06, 2007
Hello

I am trying to store a SQL statement within a data field eg Select name from salesmen where team ='North Team'

When I inset the text it becomes truncated. I have worked out that ASP is cutting the sdtatement based on the quote.

Is there a way of enabling users to record this type of data via asp and dreamweaver.

I have tried using replace

<%=Replace(Request.Form("EXPROCD_SQL"), "'", "''") %>

But I get an odbc error message. incorrect syntax near ".

Many thanks

Steve
TOPICS
Server side applications
176
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 06, 2007 Mar 06, 2007
LATEST
The SQL Statement does work:

UPDATE tbl
SET col1 = 'SELECT * FROM tbl WHERE item=''North Team'''
WHERE (ID = 1000)

Can you get it to output what it is trying to store in the database? The replace statement you are using looks good to me.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines