Skip to main content
Participant
March 6, 2007
Question

Problem with Quotes in insert staement

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
This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Participating Frequently
March 6, 2007
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