all groups > inetserver asp db > december 2006 >
You're in the

inetserver asp db

group:

please check my asp code


Re: please check my asp code Evertjan.
12/17/2006 12:00:00 AM
inetserver asp db: wrote on 17 dec 2006 in microsoft.public.inetserver.asp.db:

[quoted text, click to view]

I think you have one table "con" with two fields "ipAdd" and "CompName"

[quoted text, click to view]

Is just a random record's field, from any IP stored, ok?

Because only now you go looking for the right one,
and incorrectly coded:

[quoted text, click to view]

response.Write() does not return a value

[quoted text, click to view]

I think it is a strange way of doing things.
You do not need a record set for this.
[in fact record sets are seldom realy "needed"]
Why not have the jet engine look for the right IP?

Expecting one username per ip is a wrong, if you do this on internet,
where some ip's are shared among thousands, and users change IP's or even
locations frequently.

However if you are on an intranet, and users do not work on eachothers
line, why not [not tested]:

============================
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
Server.MapPath("users.mdb") & ";"

sql="SELECT ipAdd,CompName FROM com WHERE ipAdd = " &
request.ServerVariables("REMOTE_ADDR")
set mD = conn.Execute(sql)

if not mD.EOF then
username = mD("CompName")
''' Just takes the first one with the right IP,
''' that comes up, if not unique.
else
username = ""
end if
%>

<form method="post">
Username
<input name="username" value="<% = username %>">
.....
==============================

--
Evertjan.
The Netherlands.
Re: please check my asp code Evertjan.
12/17/2006 12:00:00 AM
wrote on 17 dec 2006 in microsoft.public.inetserver.asp.db:

[quoted text, click to view]

1 [Please do not toppost on usenet]

2 This is a new question, should have a new thread and new subject

3 What about my advice, did you try it?

4 Users do not have computer names on an internet web browser,
however you could politely ask the user for it, and that is not an ASP
serverside code matter. Automatic identification of the user under normal
internet web security is not possible. Try perhaps password and cookies.

--
Evertjan.
The Netherlands.
please check my asp code iskofajardo NO[at]SPAM yahoo.com
12/17/2006 12:08:57 AM
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:


<html><title>sample search</title>
<body>

<%
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")
%>
<form method="post">
Username <input type="text" name="username"
value="<%=rs.Fields("CompName")%>">
<% do until rs.EOF

if rs.fields("ipAdd")=ip then
username=response.Write(rs.fields("CompName"))
end if
rs.MoveNext
loop
rs.Close
set rs=Nothing %>
</form>

</body>
</html>
Re: please check my asp code iskofajardo NO[at]SPAM yahoo.com
12/17/2006 2:27:55 AM
who can help me? i need to get the computer name of the user.. please?
can anybody know how can make it possible? give me some pointers and
codes as well... i want the idea...

[quoted text, click to view]
"the delete-update method in ADO" was Re: please check my asp code Evertjan.
12/19/2006 12:00:00 AM
wrote on 19 dec 2006 in microsoft.public.inetserver.asp.db:
[quoted text, click to view]

AGAIN: [Please do not toppost on usenet, this is not email]

[quoted text, click to view]

Sorry, I cannot follow you here, perhaps show some code.

[And please use the shift key where appropriate, this is not SMS]

And please start a new thread when you have a new question,
and give it a subject line that indicates the question.

--
Evertjan.
The Netherlands.
Re: please check my asp code iskofajardo NO[at]SPAM yahoo.com
12/19/2006 2:19:31 AM
yes i try your advice and it really work... thank you soo much... now
my login project almost done, just a "Change Password" left... i try
the delete-update method in ADO... the delete was working, but the add
and updates get me confuse... coz it add a record which is outside the
row of my table... i mean the new password saved to the next line of my
table.... i hope you can help me again...

again thank you very much... it really works...

[quoted text, click to view]
AddThis Social Bookmark Button