473,396 Members | 1,843 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,396 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 1335
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.