please check my asp code
am 17.12.2006 09:08:57 von iskofajardo
hello... can somebody tell what is the error of my codings? coz i want
to create a search control... this is suppose to be the flow, at first
run i declare a ServerVariable which is ("Remote_Addr") to detect the
ipaddress... i also have a textfield in my form which must show the
"CompName"
then i have a 2tables inside my database.. (1)ipAdd and (2)CompName.. i
already input the datas needed. my condition is like this, if
ServerVariable("Remote_Addr") = ipAdd then,
i want to show the field of CompName inside the textfield as its
corresponding value...
what can i do? please check and correct me coz i always experience
error...
my codings is like this:
sample search
<%
dim ip
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("users.mdb"))
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT DISTINCT ipAdd FROM com"
rs.Open sql,conn
username=request.form("username")
ip=request.ServerVariables("REMOTE_ADDR")
%>
Re: please check my asp code
am 17.12.2006 10:43:09 von exjxw.hannivoort
wrote on 17 dec 2006 in microsoft.public.inetserver.asp.db:
> hello... can somebody tell what is the error of my codings? coz i want
> to create a search control... this is suppose to be the flow, at first
> run i declare a ServerVariable which is ("Remote_Addr") to detect the
> ipaddress... i also have a textfield in my form which must show the
> "CompName"
>
> then i have a 2tables inside my database.. (1)ipAdd and (2)CompName.. i
I think you have one table "con" with two fields "ipAdd" and "CompName"
> already input the datas needed. my condition is like this, if
> ServerVariable("Remote_Addr") = ipAdd then,
> i want to show the field of CompName inside the textfield as its
> corresponding value...
>
> what can i do? please check and correct me coz i always experience
> error...
>
[..]
>
> <%
> dim ip
>
> set conn=Server.CreateObject("ADODB.Connection")
> conn.Provider="Microsoft.Jet.OLEDB.4.0"
> conn.Open(Server.Mappath("users.mdb"))
>
> set rs=Server.CreateObject("ADODB.recordset")
> sql="SELECT DISTINCT ipAdd FROM com"
> rs.Open sql,conn
>
> username=request.form("username")
> ip=request.ServerVariables("REMOTE_ADDR")
> %>
>
>
>