By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,098 Members | 2,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,098 IT Pros & Developers. It's quick & easy.

running a script from a page I was redirected to

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.