Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with SQL UPDATE via SQLEXEC
Message
From
11/04/1998 03:48:37
Raul Davila
Davila Programming Services
Toa Alta, Puerto Rico
 
 
To
10/04/1998 23:46:53
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00091200
Message ID:
00091267
Views:
23
>>I've been fighting this problem for several hours and I'm getting no where. I hope someone out there can help. Basically I have the exec string being built as follows:
>>ccmd = "update clmlog set descrip='" + thisform.edbDescrip.value +; "' where recno()=13"
>>
>>iErr = sqlexec( iConn, ccmd )
>>
>>The edbDescrip control is an editbox and if there are no carriage returns within it then this works fine, however, one or more carriage returns within the control gives me an odbc error "37000 - Command contains unrecognized phrase/keyword" when submitted to the sqlexec function. Does anyone have any ideas?
>>
>>Thanks,
>>Larry Wainwright
>
>To my understanding RECNO() is not available in SQL SERVER.

Try this:

CRLF = chr(13) + chr(10) &&Carriage Return/Line Feed

if CRLF $ thisform.edbDescrip.Value
counter = 1
do while .t. && find a replacement for CRLF not found in the editbox
replacement = replicate('*', counter)
if !replacement $ thisform.edbDescrip.Value
exit
endif
enddo
temp_value = strtran(thisform.edbDescrip.Value , CRLF, replacement)
ccmd = 'update clmlog set descrip = strtran(temp_value, replacement, CRLF) where recno() = 13'
else
temp_value = thisform.edbDescrip.Value
ccmd = 'update clmlog set descrip = temp_value where recno() = 13'
endif
iErr = sqlexec( iConn, ccmd )

HTH
R. Davila
DBA / Network Administrator
Administracion de Fomento Comercial
Gobierno de Puerto Rico

Still waiting for FoxPro for LINUX
Previous
Reply
Map
View

Click here to load this message in the networking platform