Re: SQL UPDATE to Memo field problem
From: Alan C. Sheffield (_at_)
Date: 12/23/04
- Previous message: Fred Taylor: "Re: ODBC driver problems"
- In reply to: Kenneth M. Stilwell: "Re: SQL UPDATE to Memo field problem"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Dec 2004 11:12:03 -0500
If I understand correctly and you are passing the entire SQL including the
char(10)'s to the ODBC driver I think I see the problem.
If this is what your doing:
$tSQL="UPDATE assemb SET assemb.ntetxt ='there is a lot of text here, bla,
bla,bla,'+Char(10)+ 'there is a lot of text here, bla, bla, bla,' Where
assemb.recnum = 302"
then you need to change it to:
$tSQL="UPDATE assemb SET assemb.ntetxt ='there is a lot of text here, bla,
bla,bla,'+CHRr(10)+ 'there is a lot of text here, bla, bla, bla,' Where
assemb.recnum = 302"
The correct function in VFP for getting a character is chr() not char().
Alan Sheffield
Programmer
Park West Gallery
"Kenneth M. Stilwell" <ken@stilwellconsulting.com> wrote in message
news:BDEFB579.1063D%ken@stilwellconsulting.com...
> Fred,
>
> When I attempt to execute this command from my environment, I receive an
> error. I am using an ODBC driver on XP for Visual FP. (I am passing this
> statement from 4D (my environment) using.
>
> $iResult:=OC Set SQL in Cursor ($CursorID;$tSQL)
>
> ...and
>
> $iResult:=OC Execute Cursor ($CursorID)
>
> $iResult (gets assigned a 1 if OK, and a -1 if it fails)
> $CursorID = obvious
> $tSQL = the SQL statement that I have sent previously which I am trying to
> execute.
>
> The nature of my error is that $iResult returns a -1 and the field is not
> updated
>
> If it fails, I trap for errors and report them from my driver
>
> The error messages from the ODBC driver returns: (on the Set SQL in Cursor
> line)
>
> Error Number = 219
> Error Level = 300
> Description = "[Microsoft][ODBC Visual FoxPro Driver]Command contains
> unrecognized phrase/keyword"
> Status = 37000
>
> The OC Execute Cursor line also errors out, obviously.
>
> The only real differece between the 2 UPDATE statements is the addition of
> the Char(10)
>
> If I run the statement w/o the Char(10), then all appears OK, not errors
and
> the FoxPro table updates correctly.
>
> Ken Stilwell
>
>
>
>
>
>
> On 12/22/04 10:05 PM, in article #vdChVL6EHA.3944@TK2MSFTNGP12.phx.gbl,
> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote:
>
> > What do you mean, "does not work"? Do you not see all your text, it's
not
> > formatted correctly, you get an error message, what?
>
- Previous message: Fred Taylor: "Re: ODBC driver problems"
- In reply to: Kenneth M. Stilwell: "Re: SQL UPDATE to Memo field problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|