Iused this code to get the IP address and host name and save it into SQL
db, while submission form using this link below
and i got this message
Microsoft OLE DB Provider for SQL Server error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.
/support/form.asp, line 26
And this is the Source code of it; please could you take a look...A lot of
'Create Our ServerVariables and Store them to a variable
<% site = Request.ServerVariables("HTTP_REFERER")%>
<% ip = Request.ServerVariables("REMOTE_ADDR")%>
<% host = Request.ServerVariables("REMOTE_HOST")%>
<% strNothing = "Bookmark" %>
if Not site > "" then site= strNothing
Const strConn = "Provider=SQLOLEDB;Data Source='web-amjad';Initial
If Rs.State = 1 Then Rs.Close
rs.Open "select * from support",conn,1,3
rs.Fields ("pc_desc") =Request.Form ("pc_desc")
rs("site") = site
rs("ip") = ip
rs("host") = host
IP Address of Client Machine
Last edited by shabbir; 1Feb2005 at 15:06..
The error you are getting is telling that SQL Server is not running properly or SQL server does not have the database correctly done.
The description of error is
Error 80040e21 is an OLE DB error. The error 80040e21 indicates that the field is too small to accept the amount of data you attempted to add. For example, the error 80040e21 may be caused by trying to insert 12 characters into a SQL Server field that is formatted to accept only 10 characters. In this case, you should insert less data.
There is no problem in the code as far as syntax is concerned.
I faced another problem we have a virtual LAN (Virtual IP addresses) and all clients connect to the one server and every body filled the form it will appear on the same IP address of the proxy server, we need to save the actual IP of the client PC
The problem is you are trying to get the internet IP of the machine and thats the ip of the router and to get the ip of machine you need the subnet mask so that you know the ip in the local network also.