Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004

    Unhappy Unanswered: OleDB Error updating FoxPro Memo field


    I'm developing a C#.NET application that writes to a FoXPro database.
    I cannot seem to update memo fields with strings longer than about 400 characters, even if I break them up into chunks of 254.

    My querystring looks something like this, but much longer with a lot of fields:

    SqlStr = "update customer set email='" + email + "', " +
    "phone='" + phone + "', " +
    "comments=" ;

    SqlStr = "'" + aMomoField[i]+ "'+ " ;
    //aMemoField is an array
    //Contains memo field broken down into chunks
    //of 254 char or less
    SqlStr = SqlStr.Subtring(1,SqlStr.Length-1); //to remove the trailing + sign

    SqlStr = SqlStr + " ,interest=" + interest ;
    SqlStr = SqlStr + " where id=" + id;

    When I execute this, I get an exception, "SQL expression too complex."

    I've been struggling with this for 2 days.
    Any help is appreciated.

  2. #2
    Join Date
    Apr 2004


    Where is the end of your for loop? Is there more code.

    I think that you may want to move the parts the add the "Insert" and "Where" outside of your for loop. It may be causeing duplicates in your final SQL. Not sure because the code seems to be chopped off.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts