472,142 Members | 1,296 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

running a script from a page I was redirected to

Hi,

I'm developing a site with a public and members section. I'm using
vbscript, asp, and an access database. The login page is processed by
the members page. If you are a valid member the member page loads.
If not the member page redirects you to the restricted access page.

On the restricted access page I want to run a script that records
information about the user trying to login. I'm using environment
variables for this. The data is captured fine but my sql query isn't
working. I can't see any restricted words in there and I don't know
why the script won't run....any help would be appreciated.

script:

sql = "insert into tblfailedlog accessdate = '" & now() & "',
path_info = '" & request.servervariables("path_info") & "',
remote_addr = '" & request.servervariables("remote_addr") & "',
remote_host = '" & request.servervariables("remote_host") & "',
request_method = '" & request.servervariables("request_method") & "',
script_name = '" & request.servervariables("script_name") & "',
server_port = " & request.servervariables("server_port") & ",
server_port_secure = " & request.servervariables("server_port_secure")
& ", server_protocol = '" & request.servervariables("server_protocol")
& "', http_accept_language = '" &
request.servervariables("http_accept_language") & "', http_host = '" &
request.servervariables("http_host") & "', http_referer = '" &
request.servervariables("http_referer") & "', http_user_agent = '" &
request.servervariables("http_user_agent") & "';"

set rs = conn.execute(sql)

even when I change the sql statement to:
sql = "insert into tbltest testdata = '" & testdata & "';"
doesn't work either.

All my other pages are working fine - inserting, updating, deleting,
and selecting.

any help would be greatly appreciated.

Thanx
Nov 12 '05 #1
2 1287
I've written very little asp so don't take the following too seriously.
set rs = conn.execute(sql)
No recordset will be returned so I usually use just
conn.execute(sql)

I don't recognize the syntax of the 'insert into' sql statement
sql = "insert into tbltest testdata = '" & testdata & "';"


I would normally use something like

strTest = "my test"
strSQL = "INSERT INTO tblTest (Field1) VALUES('" & strTest & "')"

Cheers,
Peter
Nov 12 '05 #2
Hi Peter, thanx for your reply

I've used set rs = conn.execute(sql) on ALL of my other pages and this
works perfectly because I can reference whichever query I need to using
the record set name.

I've also tried using the query string with the syntax you suggested and
that returned the same results.

I'm really at ends with this code because as I said, it works fine on
other pages.

Tonya

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Max | last post: by
5 posts views Thread by mherman3 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.