Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weired Behaviors of my ASP files in VPN enviornment

Status
Not open for further replies.

Hannamja

Programmer
Feb 4, 2005
10
US
I don't know how I should describe this matter

Okay, I have some asp pages running fine on regular ISP network environments.

I use VPN connection in order to connect with the network my company provided. When I browse in VPN environments, the pages passes only upto two asp pages (which contains database connection to use select statement). On the 3rd pages, the page doesn't go anywhere.

The page it got shopped as follows

<%@ Language=VBScript %>
<!--#include file = "../inc/dbcon.asp"-->
<%

If Session("Access_ok") = "" then
Response.Redirect ("Session_End.asp")
Else
'Search table based on the inserted User ID
sqlstr = "SELECT * FROM xxxx WHERE PIN_NUM = '" & pin_num & "'"
sqlstr = sqlstr & "AND REMOTE_IP = '" & Request.ServerVariables("REMOTE_ADDR") & "'"
set rs = dbCon.Execute(sqlstr)

If not rs.EOF Then

%>
<script language="javascript">
alert("You are already voted");
location.href = "../index.asp";
</script>
<%
else 'if this is the first time to participate the survey

%>

<%

'for the first voter; save IP address and pin number

sqlstr2 = "INSERT INTO xxxxx (PIN_NUM, REMOTE_IP) VALUES"
sqlstr2 = sqlstr2 & "('" & Session("Access_ok") & "'"
sqlstr2 = sqlstr2 & "," & "'" & Request.ServerVariables ("REMOTE_HOST") & "'"
sqlstr2 = sqlstr2 & ")"

dbCon.Execute (sqlstr2)


End if 'end if If not rs.EOF Then

%>
<meta http-equiv="Refresh" Content="0; url=../en_xxx_01.asp?">

<%
RS.Close
Set RS = Nothing
dbCon.Close
End if
%>

I tried to save IPAddress so that once someone already came this page then I'd like to stop to access it.

I could type and it goes fine.

The problem starts now.

I thought the page can't be displayed becuase I uses REMOTE_ADDR in VPN environment. So, I deleted this page and made to go to en_xxx1.asp. Now, I can't display en_xxx1.asp and can't type en_xxx1.asp to display.

Can anyone tell me what's going on??
 
Likely some proxy related issue.

Make a simple page that flips through the Request.ServerVariables collection and use it to test for wierdness.
[tt]
<%
For Each Thing in Request.ServerVariables
Response.Write Thing & " = " & Request.ServerVariables(Thing) & "<br>" & vbCrLf
Next
%>
[/tt]
 
If you are using Internet Explorer try turning off Friendly HTTP Error Messgaes (Tools...Internet Options...Advanced) which will give you some more information about why the page can't be displayed.
 
Microsoft OLE DB Provider for ODBC Drivers error '80040e57'



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



/xxx/xxx/xx/index_02_ok.asp, line 37


Yeap, I agree with you that Proxy Server blocks the access.

How shall I find work around? Rather than force to insert the participant's IP address, how could I block someone to answer twice for the survey?
 
I try to put "HTTP_X_FORWARDED_FOR" instead of "REMOTE_ADDR" and now the page shows "Service Unavailable".
Do you think is this because of the firewall?
May be I should find another way to check the user's identity.
Thank you for help.
 
I did a Google for that error and it says the error is most commonly caused by the wrong kind of data being put in a column in the table or maybe you have set a column length and the data is too long to go in.


Also if you use a Response.Write statement to display the values for the variables before you try to write them to the database you will have a better idea of what you are dealing with.

Good luck!

E.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top