String or binary data would be truncated - Posted (2255 Views)
Junior Member
slemieux
Posts: 234
234
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]<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Junior Member
tilttek
Posts: 333
333
quote:

This doesn't appear to work in mysql. In the who's online mod, in onine2.asp, is the following code

    if rsWho.eof or rsWho.bof then

Set objRS2 = Server.CreateObject("ADODB.Recordset")
objRS2.Open "FORUM_ONLINE", objConn, 1, 2, 2
objRS2.AddNew
objRS2("UserID") = User
objRS2("Status") = "LOGIN"
objRS2("DateCreated") = fDate
objRS2("CheckedIn") = CheckInTime
objRS2("M_BROWSE") = Location
objRS2.Update
objRS2.close
else
strSql = "UPDATE FORUM_ONLINE SET M_BROWSE = '" & Location & "' , DateCreated = '" & fDate & "' WHERE UserID = '" & User & "'"
my_Conn.Execute (strSql)
end if

Using mysql it fails with the following error
3219 | Operation is not allowed in this context.
if you change the code to

    if rsWho.eof or rsWho.bof then
on error resume next
Set objRS2 = Server.CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO " & strTablePrefix & "ONLINE ( UserID,Status,DateCreated,CheckedIn,M_BROWSE) VALUES ("
strSql = strSQL & User & ",'LOGIN','" & fDate & "','" & CheckInTime & "','" & Location & "')"
my_Conn.Execute (strSql)
if err.number <> 0 then response.write err.number & "|" & err.description
else
strSql = "UPDATE FORUM_ONLINE SET M_BROWSE = '" & Location & "' , DateCreated = '" & fDate & "' WHERE UserID = '" & User & "'"
my_Conn.Execute (strSql)
end if
everything works OK.


I did look at you code closely and sould work. What's objConn?


Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com<
Posted
Forum Admin
HuwR
Posts: 20611
20611
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = strConnString
objConn.Open


'Resistance is futile'<
Posted
Junior Member
tilttek
Posts: 333
333
quote:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = strConnString
objConn.Open


'Resistance is futile'

In objRS2.Open "FORUM_ONLINE", objConn, 1, 2, 2
change it for objRS2.Open "FORUM_ONLINE", strConnString, 1, 2, 2

I don't have my code here, nor my book, so I can't validate... I'm at work in Java...
But looking at the code I did send, this might do the trick. I'll try to retest this...


Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com<
Posted
Forum Admin
HuwR
Posts: 20611
20611
According to IIS

To optimize performance, avoid using the ADO record addition and deletion methods, such as AddNew and Delete. If your application adds and deletes records intensively, your application will perform better if it uses direct SQL statements, such as INSERT.
'Resistance is futile'<
Posted
Junior Member
tilttek
Posts: 333
333
quote:
According to IIS

To optimize performance, avoid using the ADO record addition and deletion methods, such as AddNew and Delete. If your application adds and deletes records intensively, your application will perform better if it uses direct SQL statements, such as INSERT.


Good thing to know... But I think they mean More that 1 Record at once.

Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com<
Posted
Forum Admin
HuwR
Posts: 20611
20611
tiltek,

did you manage to find out why I was getting the error on MYSQL ?
'Resistance is futile'<
Posted
Junior Member
tilttek
Posts: 333
333
I didn't have the time to look at it... I know there are some problems with ADO (it's documented on MySQL site), but it's not our problem. Are you using MySQL (I don't remember if it install its self with MySQL for Window)?
I hope to have time to look at it this week end. But I'm not sur. I wont be at home very often.

Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com<
Posted
Forum Admin
HuwR
Posts: 20611
20611
I don't use it, I was hust testing some install scripts for the Mods,
so I figured I would test the whole site.
'Resistance is futile'<
Posted
Snitz Forums Admin
Reinsnitz
Posts: 3545
3545
Considering this a feature of the Database in question/Hardware the DB is running on as opposed to a forum related issue.

Closing This and it's sibling topic at: http://forum.snitz.com/forum/link.asp?TOPIC_ID=1518 also, I'm moving this topic to the FAQ forum for Heptite to note in her work there.
Reinsnitz (Mike)
><)))'> "The glory of young men is their strength, and the honor of old men is their gray hair." - Proverbs 20:29
<
You Must enter a message