Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL - 255 character limit
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00351774
Message ID:
00353352
Views:
14
>Does anybody know of a workaround for inserting more than 255 characters into a VFP memo field with SQL? I am invoking an SQL statement from within an Active Server Page but the problem can also be demonstrated from within the Command Window of VFP (v. 6.0)
>
>The code I have is similar to this:
>
><%
>memovalue = "now is the time for all good men to come to the aid of their party"
>
>SQL = "INSERT INTO test (memofield) VALUES ( '" & memovalue & "')"
>
>REM 'Insert our new record into the table'
>set conn = server.createobject("ADODB.Connection")
>conn.open "DSNentry"
>REM 'Created a link to the table...'
>
>conn.execute(SQL)
>REM 'record added'
>conn.close
>SET conn = Nothing
>%>
>
>This works perfectly fine just as long as "memovalue" never is larger than 255 characters. It doesn't appear to matter how long the entire SQL statement is just as long as no one value parameter is longer than the character limit.
>
>Any help would be greatly appreciated.
>
>Thanks in advance,
>
>David Pizon
>pizond97@mio.uwosh.edu
>Lead Webmaster
>Management Information Office
>UW Oshkosh

Can you get the lenght of the statment at the front end and see if it is longer that the dreaded 255?

If so chop it into parts , and them together and it will run! Having done this you look for a catch phrase that will be in the middle of the command. I chose "WHERE" myself.

Search the string for your word and get it's numeric location. No substring it to that point as str1. Substring the remainder to st2

sqlStr =str1 + str2

CYA here! use brackets instead of quotes because a quote can be used in the example area of the "where" : CCity = 'NYC'

now you can pass sqlstr to where ever you need it.

__Stephen
Previous
Reply
Map
View

Click here to load this message in the networking platform