Ask a Question related to ASP Database, Design and Development.
-
Supaya #1
sql script won't run asp page
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
Supaya Guest
-
Add a page by Script
I create dynamicly fields and I want to add pages if nécessary. I just want to duplicate a page (its background)whitout the fields on it. I tried... -
Intermediate Page w/ CGI Script
I'm working on a CGI application using Perl. My client would like the user to get some sort of "processing request" page immediately upon clicking... -
load the PHP script last on the page
I have a page with a particular PHP section that takes quite a time to load. Is there a way I can delay that script to run after everything else has... -
Passing value from one script on one page to another script on another page.
Hi All, I have what is an easy question for you all, but I have not idea (this is in vbscript). I have this script below that works great. It... -
how to interact client script within aspx page to other page functions, etc.? PLEASE!!!
Hi, I've spent all day trying to find some info on this...please help! I have an aspx page with an xmlDocument (not dataset/relational db) with... -
Raymond D'Anjou \(raydan\) #2
Re: sql script won't run asp page
Just before:
add:> set rs = conn.execute(sql)
response.write sql
response.end
Run the page to see your SQL statement.
Try to spot the error in the string.
If you can't see anything there,
copy the string and run it directly in your database.
"Supaya" <tonyabishop@hcse.ca> wrote in message
news:eaf17c37.0404010807.4f02331a@posting.google.c om...> 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
Raymond D'Anjou \(raydan\) Guest
-
Maarten #3
Re: sql script won't run asp page
accessdate = '" & now() & "',
Besure in mm/dd/yyyy format and surrounded with #01/31/2003#
Maarten Guest
-
Manohar Kamath [MVP] #4
Re: sql script won't run asp page
The INSERT statement syntax is
INSERT INTO TableName VALUES (... comma separated...);
and if you are specifying field names to insert, then
INSERT INTO TableName (.. comma separated field names...) VALUES (... comma
separated...);
So,
sql = "insert into tbltest (testdata) VALUES ('" & testdata & "');"
should work.
--
Manohar Kamath
Editor, .netWire
[url]www.dotnetwire.com[/url]
"Supaya" <tonyabishop@hcse.ca> wrote in message
news:eaf17c37.0404010807.4f02331a@posting.google.c om...> 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
Manohar Kamath [MVP] Guest
-
Supaya . #5
Re: sql script won't run asp page
I've tried writing the sql statement to the sceen and it looks great,
all the data is there. it only fails when I execute it. Then I get
syntax error in insert into .... but it doesn't specify where.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Supaya . Guest
-
Supaya . #6
Re: sql script won't run asp page
I've tried that too with the same results.
:(
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Supaya . Guest



Reply With Quote

