Re: SQL UPDATE to Memo field problem

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Alan C. Sheffield (_at_)
Date: 12/23/04

  • Next message: Nico den Boer: "Re: ODBC driver problems"
    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?
    >


  • Next message: Nico den Boer: "Re: ODBC driver problems"

    Relevant Pages

    • RE: MS SQL, find list of tables
      ... connected to the Access ODBC driver. ... MS SQL, find list of tables ... Audit your website security with Acunetix Web Vulnerability Scanner: ... Up to 75% of cyber attacks are launched on shopping carts, forms, ...
      (Pen-Test)
    • Re: Strange ODBC error
      ... I have googled for this error, and it seems to be a very common Oracle ... SQL returns the error above. ... please use Oracle's ODBC driver. ... understand how the first SQL sent by the application works ok, ...
      (comp.databases.oracle.misc)
    • iSeries ODBC and Memory Leaks
      ... I'm using IBM's iSeries Access ODBC driver to access data from ... SQL 2005 via a Linked Server and with SQL Integration Services. ... mentions ODBC memory leaks. ... IBM DB2 for OS/400 V5R1 and later ...
      (microsoft.public.sqlserver.odbc)
    • Re: syntax error at or near "{" at character 86(#-1)
      ... Connecting using the PostgeSQL ODBC driver. ... tracking turned on and it shows a different statement SQL statement created ... in Access than is being actually sent to SQL. ...
      (microsoft.public.access.queries)
    • Re: uploading file into sql 2005 using .asp
      ... I also noticed that you are using the ODBC driver. ... take note that this code works perfectly well when inserting into SQL 2000 ... Anyone who can send me a sample code of how to upload a file into SQL ... the browser and the web server or between the web server and the ...
      (microsoft.public.inetserver.asp.db)