Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 27th, 2005, 01:38 PM
Registered User
 
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ms Access stored query problem

I have a very simple Access query stored in my database. Its only confirms the user name and first address line. It is working fine in access but it is not working from asp if I am entering any value starting with number in form.

here is my code

stored query:
SELECT customer.*
FROM customer
WHERE ((customer.c_surname=customersurname) And (customer.c_pcode=customerpostcode) and (customer.c_add1=[customeradd]));

and here is the asp code:



<%
    set rslogin = server.createobject("ADODB.recordset")

    customersurname=request.form("customer_surname")
    customeradd=trim(cstr(request.form("customer_add") ))
    customerpostcode=request.form("customer_postcode")

    makeConnection("data/villa.mdb")

    if customersurname="" or customeradd="" or customerpostcode="" then
            Session("loginerrormsg")=" Customer details are empty. Please try again."
            response.redirect("default.asp")
    else

        sql="exec getcustomerLoginInfo "&customersurname&","&customerpostcode&","&custome radd

        rslogin.open sql, ConnVilla
        if rslogin.eof or rslogin.bof then
            Session("loginerrormsg")=" User name or password is not correct. Please contact administrator."
            response.redirect("default.asp")
        else
            Session("loginerrormsg")=" Welcome!.."
            session("logged")="some one logged in"
            session("user_name")=rslogin("c_name")&" "&rslogin("c_surname")
            session("login_type")=""
            Response.Redirect("default.asp")
        end if
        closeConnection
    end if

%>

and here id the error I am getting:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '324wed'.

if I enter '324wed' or anything starting with number in to any field in my form I am getting the error above.

Would you please help me.






Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO: create stored procedure in Ms access Kaustav Access 5 December 19th, 2014 01:14 PM
MS Access .mdb calling SQL server 2000 stored proc fazzou Access 6 September 8th, 2006 11:32 AM
stored procedures and MS Access madhukp Classic ASP Basics 5 August 26th, 2004 12:22 AM
Stored Procedure Error in MS Access belete Access 2 June 24th, 2004 02:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.