Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Frequently Asked Questions
 FAQ Addition Requests
 String or binary data would be truncated
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

slemieux
Junior Member

USA
234 Posts

Posted - 22 November 2000 :  18:00:03  Show Profile  Reply with Quote
I assume this is a known issue here at forum.snitz.com

Microsoft OLE DB Provider for ODBC Drivers error '80040e57'
[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.
/forum/post_info.asp, line 625

when posting a lengthy reply

Or is it a built in cut off to keep us from blabbing away

Scott LeMieux

[moved by admin on 01/06/2001]<

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 22 November 2000 :  18:08:49  Show Profile  Visit HuwR's Homepage  Reply with Quote
There is a size limit when posting using ado, around 7000 chars

'Resistance is futile'<
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 23 November 2000 :  01:17:01  Show Profile  Visit gor's Homepage  Reply with Quote
Any objections if I move this out of here then into a FAQ forum ?

For the post to be here I would like it to be something we can fix in de source code.

Am I right that this only happens here or does it also happen with different databases than SQL Server ?


Pierre Gorissen

Even if you're on the right track,
you'll get run over if you just sit there.

Will Rogers<
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 23 November 2000 :  02:30:31  Show Profile  Reply with Quote
quote:
Am I right that this only happens here or does it also happen with different databases than SQL Server ?
I have no problem posting a message over 7000 chars in length using access. But I do get an 'exception occured' error when I try to post 87000 chars using access.

*----*----*----*----*----*----*----*----*----*----*----*
"However, if you suffer as a Christian, do not be ashamed,
but praise God that you bear that name."

1 Peter 4:16
<
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 23 November 2000 :  13:00:08  Show Profile  Reply with Quote
There is no inherent size limit on posting text to SQL server as long as the destination field is a TEXT field. Refer to http://support.microsoft.com/support/kb/articles/Q194/9/75.ASP

======
Doug G
======<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 07 December 2000 :  05:32:45  Show Profile  Visit HuwR's Homepage  Reply with Quote
I think we need to try and address this, it was discussed previously here
http://forum.snitz.com/forum/link.asp?TOPIC_ID=1518

The quote I posted was from a Technet CD, the issue is not with the DB, but the use of a single INSERT to post data > 9000 chars.

I have both an access and a SQL db, the error occurs on both. It may be an MDAC2.5 problem and be fixed in 2.6. So if you can tell us what ver you were using to
quote:

I have no problem posting a message over 7000 chars in length using access. But I do get an 'exception occured' error when I try to post 87000 chars using access




'Resistance is futile'<
Go to Top of Page

tilttek
Junior Member

Canada
333 Posts

Posted - 07 December 2000 :  14:57:17  Show Profile  Visit tilttek's Homepage  Reply with Quote
Hi, I'm only looking at Snitz... But It seem to be a very good forums. I didn't have time to look at the code but it seem you use a simple INSERT statement to add to the DB.
Using ADO it's not the best way.

Here some tip: use:

Dim objRecordset
Set objRecordset = Server.CreateObject("ADODB.Recordset")
' data in the table.
objRecordset.Open "TableName",DB_CONNECTIONSTRING,adOpenKeyset,adLockPessimistic,adCmdText
objRecordset.AddNew
objRecordset.Fields("text_field") = CStr(WeekdayName(WeekDay(Date())))
objRecordset.Fields("integer_field") = CInt(Day(Now()))
objRecordset.Fields("date_time_field") = Now()
objRecordset.Update
' Get the DB assigned ID of the record we just added.
iRecordAdded = objRecordset.Fields("id").Value
objRecordset.Close
Set objRecordset = Nothing

And if it's the way you already doing it.... It might be an other problem... SQL Memory Page Size for exemple... In version 6.5 it was realy a big problem... (2K Page).



Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com<
Go to Top of Page

isuru
Junior Member

464 Posts

Posted - 07 December 2000 :  15:27:52  Show Profile  Reply with Quote
Unless Im mistaken that code doesn't use SQL.

Therefore it won't be compatible with all supported Databaes (eg MySQL) will it?

-=-=-=-=-=-=-=-
Isuru Amarasena <
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 07 December 2000 :  15:57:46  Show Profile  Visit HuwR's Homepage  Reply with Quote
Someone who uses MYSQL will have to comment on that

'Resistance is futile'<
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 08 December 2000 :  01:26:54  Show Profile  Reply with Quote
I tried to post earlier in response to:
http://forum.snitz.com/forum/link.asp?TOPIC_ID=2547

I was going to post the code from a file that I was using. In my Text Editor, the document properties said it was 9,676 characters.

This promptly resulted in the following:

Microsoft OLE DB Provider for ODBC Drivers error '80040e57'

[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.

/forum/post_info.asp, line 625


Would it be possible to check for dbtype and do a case statement and optimize where possible for the different types of databases? Especially if there is an alternative way for SQL Server/Access that will work? I do remember seeing in the code that there were some areas where things were done differently for mysql.

<
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 08 December 2000 :  01:31:32  Show Profile  Reply with Quote
If I'm not mistaken, isn't this still ADO?
--> Server.CreateObject("ADODB.Recordset")

Or was the intent to show a better way to use ADO if we must use it?

Just curious.

quote:

Using ADO it's not the best way.

Here some tip: use:

Dim objRecordset
Set objRecordset = Server.CreateObject("ADODB.Recordset")
' data in the table.
objRecordset.Open "TableName",DB_CONNECTIONSTRING,adOpenKeyset,adLockPessimistic,adCmdText
objRecordset.AddNew
objRecordset.Fields("text_field") = CStr(WeekdayName(WeekDay(Date())))
objRecordset.Fields("integer_field") = CInt(Day(Now()))
objRecordset.Fields("date_time_field") = Now()
objRecordset.Update
' Get the DB assigned ID of the record we just added.
iRecordAdded = objRecordset.Fields("id").Value
objRecordset.Close
Set objRecordset = Nothing




<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 08 December 2000 :  03:45:08  Show Profile  Visit HuwR's Homepage  Reply with Quote
Both ways are using ADO, the way the forum does it is to execute an SQL query,the example tilttek showed was using the properties of the ADO recordset to set it's values.

I am not sure that all recordset properties are supported by all the diferent DB drivers.

We need a mysql user to comment on this so we can decide what best to do.

'Resistance is futile'<
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 08 December 2000 :  10:57:43  Show Profile  Reply with Quote
If you're taking votes from disinterested parties, I vote to use an INSERT SQL statement instead of a recordset whenever possible. I don't have MySQL, however I would think a recordset object can be used with a MySQL backend.


======
Doug G
======<
Go to Top of Page

tilttek
Junior Member

Canada
333 Posts

Posted - 08 December 2000 :  11:16:12  Show Profile  Visit tilttek's Homepage  Reply with Quote
I did work ADO with:
  • SQL Server 6.5, 7.0
  • Access 9x, 2000
  • Oracle

  • SQL Anyware
  • MySQL


And using this method, was the fastest and safest way to implement into all of them. First you don't have the DATE format difference, you don't need to have many SQL Statement depending of the DB used, and you don't have the 2k Page limit of SQL Server 6.5...

And yes MySQL can use this way... Maybe internaly it recreate a Insert.... But we don't care.

Did a software that had to work with all of them, and that was the way to do it. I'm programming on the web for about 6 years. And 11 years as pass, from the first
time I use Usenet and FTP.

Yes I'm new here... But not on the web.


Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 08 December 2000 :  14:15:32  Show Profile  Visit HuwR's Homepage  Reply with Quote
Thanks for the info tilttek, I think this will be a major coding change, but maybe short term would solve the message posting.

I shall take a look and let Mike and Gor know what I think.

'Resistance is futile'<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 08 December 2000 :  20:09:00  Show Profile  Visit HuwR's Homepage  Reply with Quote
Hmmm,

We need more info from people with this problem.
I have just succesfully posted > 60000 chars against both my
SQL and Access DB's using the forum?

I'm sure it didn't work before.

Anyway, my version of ADO is 2.5

'Resistance is futile'

I just installed MySQL on by home server, and successfully posted the same message to the MySQL DB.

I would therfore summise it is not a problem with the forum code, but a driver specific problem.

Edited by - huwr on 08 December 2000 21:26:23<
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07