sql script won't run asp page

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default Re: sql script won't run asp page

    Just before:
    > set rs = conn.execute(sql)
    add:
    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

  4. #3

    Default Re: sql script won't run asp page

    accessdate = '" & now() & "',

    Besure in mm/dd/yyyy format and surrounded with #01/31/2003#


    Maarten Guest

  5. #4

    Default 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

  6. #5

    Default 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

  7. #6

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139