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

Problems with mediumtext in update statement

Status
Not open for further replies.

webIntern

Programmer
Nov 22, 2002
40
US
I have a web page that updates records in a mySQL database. I'm having trouble updating the fields that are of "mediumtext" type. When I'm updating that field using ASP/vbscript, the value is a string. I get the following error on the page:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-4.0.14-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc='testing solution testing testing', challenge='testing te

My sql update string looks like this:
sSqlString = "UPDATE casestudy SET sector=" & ssector & ", client=" & sclient & ", solution=" & ssolution & ", desc=" & sdesc & ", challenge=" & schallenge & ", result=" & sresult & " WHERE num = " & number

OH and the string variables all already have single quotes around the the values.

Can someone help me...please...thanks in advance
 
Actually, your update string does not look like:
Code:
sSqlString = "UPDATE casestudy SET sector=" & ssector & ", client=" & sclient & ", solution=" & ssolution & ", desc=" & sdesc & ", challenge=" & schallenge & ", result=" & sresult & " WHERE num = " & number

That's just the code that creates it.

I recommend as a first step that you output the created query to the browser and examine it.


Want the best answers? Ask the best questions: TANSTAAFL!!
 
You're right, it was because 'desc' is a reserved word. I changed the name of the field in the database and updated that change in my code. Everything works now.

Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top