473,378 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 1332
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Phil Powell | last post by:
http://www.sitepoint.com/article/910/2] How can it be possible to use Apache's mod_rewrite module in such a way as to dynamically feed it variable information into the "RewriteRule" option? I...
10
by: Max | last post by:
Hello all, I am trying to protect a page within my site with a JS password scheme. Now I know JS can be quite easily "circumvented", but I came by a code below. My question is: 1. Is there...
2
by: Supaya | last post by:
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...
5
by: mherman3 | last post by:
I have a page that sends a request to another PHP page on my site. If I try and set the header in the page that is being called, with header(Location: ...), the site doesn't get redirected like I'd...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.