logo       

Cannot insert/update columns with data that contains both single and double: msg#00176

db.mysql.windows

Subject: Cannot insert/update columns with data that contains both single and double quotes from Windows via ADO

I have a MySQL database. I am reading in a value from a database on the
server that contains html code. I am trying to insert/update the values
into a MySQL database on the internet. For example, I need to import a
hyperlink that references a JavaScript window. The html looks like:

UPDATE table SET column='value'

<a
href="javascript:launchwindow14('http://www.domainname.com/dcconnecters.htm'
)">See Connectors</a>

As you can see, there is are two double quotes and two single quotes. If I
construct the value to be bracketed with single quotes and change the all
the quotes to doubles ('',""), then the query will work. However, it will
not write one of the doubles quotes to the database. If I bracket the value
with single quotes, then the doubled double quotes will not pass into
the database, i.e.:

'<a
href=""javascript:launchwindow14(''http://www.domainname.com/dcconnecters.ht
m'')"">See Connectors</a>' will result in a database value of:

<a
href=""javascript:launchwindow14('http://www.domainname.com/dcconnecters.htm
')"">See Connectors</a>

If I change it and construct is as:

"<a
href=""javascript:launchwindow14(''http://www.domainname.com/dcconnecters.ht
m'')"">See Connectors</a>", it results in:

<a
href="javascript:launchwindow14(''http://www.domainname.com/dcconnecters.htm
'')">See Connectors</a>

If I use phpMyAdmin or MySQL CC on Windows 2000, the following value will
work properly:

'<a
href=\"javascript:launchwindow14(\'http://www.domainname.com/dcconnecters.ht
m\')\">See Connectors</a>'

>From Windows VB/Automate, I get the following error:

ADODB.Parameters:Parameter object is improperly defined. Inconsistent or
incomplete information was provided.

Connection String looks like:

Provider=MSDASQL.1;Persist Security Info=False;Data Source=DSName


I really think that this can be accomplished. The question is, how?


--
Keith Roberts
IT Manager - Laptops For Less
2995 White Star
Anaheim, CA 92806
http://www.laptopsforless.com
714.224.3980


---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html"; before
posting. To request this thread, e-mail win32-thread10645@xxxxxxxxxxxxxxx

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail win32-unsubscribe@xxxxxxxxxxxxxxx instead.




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise