If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > OleDB Error updating FoxPro Memo field

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-08-04, 12:18
priyaj priyaj is offline
Registered User
 
Join Date: Jul 2004
Posts: 1
Unhappy OleDB Error updating FoxPro Memo field

Hi,

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=" ;

for(i=0;i<=count;i++)
{
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.
Reply With Quote
  #2 (permalink)  
Old 07-08-04, 14:35
AceOmega AceOmega is offline
Registered User
 
Join Date: Apr 2004
Location: Arizona
Posts: 49
???

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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On