English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Is it possible to Request.ServerVariables and then load them into a recordset? If so, can someone show me how to do this?

Much thanks!

2007-03-21 07:31:05 · 1 answers · asked by UBigDummie 1 in Computers & Internet Programming & Design

1 answers

yes, of course, Request.ServerVariables return string, and you can store that into a recordset. example:

if you want to use this code, create a table in a databace and name it "visitores".
constr:connection string

'**************************************************************
set conn=Server.CreateObject("ADODB.Connection")
set rs=Server.CreateObject("ADODB.Recordset")
conn.open constr
rs.open sqlStr,conn,1,2
rs.addNew
sqlStr="SELECT * FROM [visitores] WHERE 0=1"
rs("clientIP")=Request.ServerVariables("REMOTE_ADDR")
rs.update
rs.close
conn.close
set conn=nothing
set rs=nothing
'************************************************************'
if you include this code into your home page, it will store visitores IP in database.

2007-03-21 08:03:27 · answer #1 · answered by Maysam 4 · 0 0

fedest.com, questions and answers