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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Microsoft JET Database Engine error '80040e57'
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

jenroux
Starting Member

United Kingdom
3 Posts

Posted - 27 September 2006 :  12:33:28  Show Profile
Hi

Forgive me if this has been asked before but I couldn't seem to find it.

I downloaded the latest version of the forum software yesterday to use as a discussion board for a personal project I'm working on.

So far only myself and two UK users have signed up and everything has been fine. However when one member tried to register (based in South Africa) he came up with this message:

Microsoft JET Database Engine error '80040e57'
The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.

/forum/inc_func_common.asp, line 585


I tried to register him here in the UK and it worked fine but he still can't login without this message coming up.

Does anyone have any ideas?

I have limited knowledge of ASP so will need any help you can offer in plain english.

TIA!
Jenni

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 27 September 2006 :  12:41:15  Show Profile
Hmm ... if you haven't made any changes to inc_func_common.asp, that error implies that his I.P. address is longer than a standard address - strangeness ...


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 27 September 2006 12:49:51
Go to Top of Page

jenroux
Starting Member

United Kingdom
3 Posts

Posted - 27 September 2006 :  12:45:46  Show Profile
I've not made any changes that I'm aware of. I could find out what his IP address is. I'll also try and get more information about where he is logging on from in case that makes any difference.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 27 September 2006 :  12:50:03  Show Profile
Just to verify that this is the problem, find the following beginning on line 581 of inc_func_common.asp:
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " SET M_LASTHEREDATE = '" & fTime & "'"
strSql = strSql & ",    M_LAST_IP = '" & UserIPAddress & "'"
strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(UserName, "SQLString") & "' "
my_conn.Execute (strSql),,adCmdText + adExecuteNoRecords
And add the following line immediately before it:

response.write UserIPAddress

Now get the member in SA to try and login again and send you on exactly what he sees on screen, his I.P. address should be the first thing in that and should be, at maximum, 15 characters long. Once you've got that off him, you can remove that line.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

jenroux
Starting Member

United Kingdom
3 Posts

Posted - 27 September 2006 :  12:58:12  Show Profile
Thanks! I've added that now I'm just waiting on him to get back to me.
Go to Top of Page

Remco
Starting Member

Netherlands
1 Posts

Posted - 06 October 2006 :  06:38:22  Show Profile  Visit Remco's Homepage
I have the same error on some PC's.
If I add 'response.write UserIPAddress' the page shows 'unknown, 212.194.xxx.xxx' so this value does not match the criteria in Access.
Anyone a suggestion?
I'm using the latest version (3.4.06).

Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 06 October 2006 :  06:50:31  Show Profile
Find the UpdateLastHereDate function beginning on line 575 of inc_func_common.asp and replace it with the following:
function UpdateLastHereDate(fTime,UserName)
	UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
	If UserIPAddress = "" or left(UserIPAddress, 7) = "unknown" Then
		UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
	ElseIf InStr(UserIPAddress, ",") > 0 Then
		UserIPAddress = Mid(UserIPAddress, 1, InStr(UserIPAddress, ",")-1)
	ElseIf InStr(UserIPAddress, ";") > 0 Then
		UserIPAddress = Mid(UserIPAddress, 1, InStr(UserIPAddress, ";")-1)
	End If
	'## Forum_SQL - Do DB Update
	strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
	strSql = strSql & " SET M_LASTHEREDATE = '" & fTime & "'"
	strSql = strSql & ",    M_LAST_IP = '" & UserIPAddress & "'"
	strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(UserName, "SQLString") & "' "
	my_conn.Execute (strSql),,adCmdText + adExecuteNoRecords
end function

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 24 October 2006 06:04:23
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 06 October 2006 :  07:01:33  Show Profile
2 similar changes will also need to be made in post_info.asp. Find 2 instances of the following beginning on lines 807 and 991:
UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if UserIPAddress = "" then
	UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
end if
And replace them with the following:
UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if UserIPAddress = "" or left(UserIPAddress, 7) = "unknown" then
	UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
elseif InStr(UserIPAddress, ",") > 0 then
	UserIPAddress = Mid(UserIPAddress, 1, InStr(UserIPAddress, ",")-1)
elseif InStr(UserIPAddress, ";") > 0 then
	UserIPAddress= Mid(UserIPAddress, 1, InStr(UserIPAddress, ";")-1)
end if

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 24 October 2006 06:04:53
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 06 October 2006 :  09:12:06  Show Profile
You'll also find the above code on line 409 of register.asp which needs to be changed in the same way.

Note that this is only a temporary solution while the Dev Team work on how best to handle muptiple IP addresses.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 22 October 2006 :  12:43:45  Show Profile  Send ruirib a Yahoo! Message
Shaggy, the code you posted has an error.
Where you now have

        ElseIf InStr(UserIPAddress, ";") > 0 Then
		UserIPAddress = Mid(UserIPAddress, 1, UserIPAddress, ";")-1)
	End If


You should have

        ElseIf InStr(UserIPAddress, ";") > 0 Then
		UserIPAddress = Mid(UserIPAddress, 1, UserIPAddress, ";")
	End If


which means the highlighted red part needs to be removed.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 23 October 2006 :  04:31:19  Show Profile
That's strange, some code went missing - fixed my posts above.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 23 October 2006 :  06:49:07  Show Profile  Send ruirib a Yahoo! Message
My correction was completely senseless anyway . I guess I didn't even understood what was happening!


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 24 October 2006 :  06:05:38  Show Profile
Updated the changes again so that it only uses REMOTE_ADDR if the first IP returned in the list is unknown.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

welshman
Starting Member

United Kingdom
6 Posts

Posted - 22 November 2006 :  08:11:24  Show Profile
Hi Everyone

I've been reading this thread with interest. I have a relatively new forum which seems to suffer from the same problem.

I have a user in Papua New Guinea who sees the error message:
~~~~~~~~~~~~~~~~~~~~~~
Microsoft OLE DB Provider for SQL Server error '80040e57'
String or binary data would be truncated.
inc_func_common.asp, line 585
~~~~~~~~~~~~~~~~~~~~~~

They have a fixed IP address which has the format 202.xxx.xxx.xxx

As I'm not sure the problem is identical I haven't dare fiddle with the code. Any suggestions as to a solution?

Many thanks in anticipation

David


Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 22 November 2006 :  08:22:04  Show Profile
Whether the problem is identical or not, you should make the changes above anyway. Just because he has a fixed IP, though, doesn't mean he isn't going through one or more proxies to access your site. If your member is still experiencing problems after making the changes, post back and let us know.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 22 November 2006 :  11:30:14  Show Profile  Visit JJenson's Homepage
Should people only make this change if they have members from countries other than the one they are in? Or if we are experiancing this problem? Or should this be a change that is needed period?


Edited by - JJenson on 22 November 2006 11:30:35
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07