Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 External Development Forums - SalesLogix OLEDB Provider
Forum to discuss using the SalesLogix OLE DB Provider from external applications (including usage of built-in provider procedures). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix OLEDB Provider | New ThreadView:  Search:  
 Author  Thread: Records inserted / updated in hostdatabase (History) but fields truncated in generated TEF
Chris
Posts: 18
 
Records inserted / updated in hostdatabase (History) but fields truncated in generated TEFYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 06 4:49 AM
fiogf49gjkf0d
Hello,

I made an external program in C# .Net using SLXProvider which inserts/updates records in History table (SLX 6.2 SP1). All fields are correctly updated in host database but the syncserver generates TEF in which fields are truncated with 41 caracters => Consequently, data are truncated in remote database !
Has anybody the same problem ? What is the solution ? Thank you !
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Records inserted / updated in hostdatabase (History) but fields truncated in generated TEFYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 06 9:22 AM
fiogf49gjkf0d
Very interesting... I have never encountered anything like this before.

Which field or fields are getting truncated and what are their data types?

Can you see the truncated data in the TEF files using the TEF Viewer, or are you just looking at the data in the remote database?

Can you post some code?
[Reply][Quote]
Chris
Posts: 18
 
Re: Records inserted / updated in hostdatabase (History) but fields truncated in generated TEFYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 06 10:20 AM
fiogf49gjkf0d
The fields truncated are History.Notes and History.longNotes (but perhaps others).
I see the truncated values in the TEF thanks to the TrnViewer.exe.

The code I use (here, to update data) :

OleDbConnection oledbconnect_cmd_slx;
OleDbCommand oledbcmd_cmd_slx;
OleDbDataAdapter DataAdpt;
OleDbCommandBuilder CBuild;
DataSet DataSet1;
DataRow DataRow1;
DataTable DataTable1;

string cs_slx="Provider=SLXOLEDB.1assword=" + str_PwdSalsa + "ersist Security Info=True;User ID=admin;Initial Catalog=" + str_DataLinkSalsa + ";Data Source=" + str_ServeurSalsa + ";Extended Properties=" + '"' + "PORT=1706;LOG=ON" + '"';
oledbconnect_cmd_slx = new OleDbConnection(cs_slx);
oledbconnect_cmd_slx.Open();

// Loop

DataAdpt = new OleDbDataAdapter("Select * from History where historyid='" + str_SLX_PhoneCall_HistoryId + "'",oledbconnect_cmd_slx);
CBuild = new OleDbCommandBuilder(DataAdpt);
DataSet1 = new DataSet("History");
DataTable1 = new DataTable("History");
DataAdpt.Fill(DataSet1,"History");

DataRow1 = DataSet1.Tables["History"].Rows[0];
DataRow1["NOTES"] = "11234567890 01234567890 01234567890 01234567890 01234567890 01234567890 01234567890 01234567890 "; // Truncated to 43 caracters in TEF !!!!

DataAdpt.Update(DataSet1,"History");

DataAdpt.Dispose();
DataSet1.Dispose();
CBuild.Dispose();

// End Loop

oledbconnect_cmd_slx.Close();

We use SLX SP1 with hotfixes 3, 5, 6, 8

Thank you.


[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Records inserted / updated in hostdatabase (History) but fields truncated in generated TEFYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 06 10:38 AM
fiogf49gjkf0d
This is a known issue related to defect 1-39307. Basically, the problem happens with any varchar parameters being truncated because internally it is defaulting to a WCHAR data type for string values, which is not supported by the provider. Since a DataAdapter internally maintains separate Command objects to perform inserts, updates, etc via parameters from the DataSet upon Update, you're seeing the same problem.

Two options to fix this:

1) Upgrade to SP4
2) Change your code so you're doing all updates & inserts via SQL statements (not parameterized). This means you also have to account for dates being ISO formatted and also worry about invalid chars in your string along with single quotes. This route sucks, see #1.

It may not be good news, but at least you won't have to keep fighting with this wondering what is wrong
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Records inserted / updated in hostdatabase (History) but fields truncated in generated TEFYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 06 10:39 AM
fiogf49gjkf0d
And to clarify, your problem will not be only with truncating notes/longnotes. The problem will happen when inserting a value longer than 47 chars into *any* string field in SalesLogix. Fun
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Records inserted / updated in hostdatabase (History) but fields truncated in generated TEFYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 06 10:57 AM
fiogf49gjkf0d
I do updates & inserts via SQL statements... this explains why I have not encountered this issue.
[Reply][Quote]
Chris
Posts: 18
 
Re: Records inserted / updated in hostdatabase (History) but fields truncated in generated TEFYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 06 11:53 AM
fiogf49gjkf0d
Thank you very much Ryan !
I've changed my code (i use a first query using dataset technic in order to insert the new record with somme fields, such as datetime fields. And just after I use a ExecuteNonQery in order to update string fields with a SQL statement "update HISTORY set xxx='fool fool fool fool fool...'".
And it seems to work fine !

Chris
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/26/2024 4:13:49 AM