Results 1 to 15 of 15

Thread: Problem in ASP

  1. #1
    Join Date
    Aug 2014
    Posts
    7

    Post Unanswered: Problem in ASP

    i am facing some issue in asp page. error is :-

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ProductID = ...'.



    Function GetPoducts(Id)

    Const adOpenForwardOnly = 0
    Const adLockReadOnly = 1
    Const adLockOptimistic = 3
    Dim objCn
    Dim objRs
    Dim strSQL
    Set objCn = Server.CreateObject("ADODB.Connection")
    Set objRs = Server.CreateObject("ADODB.Recordset")
    objCn.open "Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)};Dbq=" & server.MapPath("Prod.mdb") & ";Uid=;Pwd=;"
    strSQL = "Select *,Format(Price,'0.00') As P From tblProduct WHERE ProductID = " & Id
    objRs.Open strSQL,objCn,adOpenForwardOnly,adLockOptimistic
    With objRs
    If not (.BOF And .EOF) Then
    strDetails = .fields("Quantity") & " x " & .fields("Name")
    dblPrice = .fields("P")
    dblTotal = dblTotal + .fields("P")
    End If
    End With
    objRs.close
    Set objRs = Nothing
    objCn.close
    Set objCn = Nothing
    End Function
    **************************************

    Some time working & some time not working.

    please help.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    What is the value of strSQL before the error?
    Write the value to screen and paste the results back here.

    P.S. Moving to ASP topic
    George
    Home | Blog

  3. #3
    Join Date
    Aug 2014
    Posts
    7

    Post Problem in ASP

    Hi gvee,

    I am not able to find strSQL value. could you please let me know. where should i find strSQL value.

    i have prod.mdb which i am sending you.

    Please help me.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    The code you pasted above refers to a variable called strSQL.
    We need to know the value of this before query execution i.e.
    Code:
    ...
    strSQL = "Select *,Format(Price,'0.00') As P From tblProduct WHERE ProductID = " & Id
    Response.Write strSQL
    Response.End
    ...
    What shows up on the webpage?
    George
    Home | Blog

  5. #5
    Join Date
    Aug 2014
    Posts
    7

    Post Problem in ASP

    when i click to add into my ecommerce site, the below errow show up.

    Shopping Cart
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ProductID = ...'.

    /orderdetails.asp, line 181

    i am sending you orderdetails.asp file into notepad.

    please check & let me know i mistake.

    many thanks for your support.
    Attached Files Attached Files

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Please read and try my suggestions above.
    George
    Home | Blog

  7. #7
    Join Date
    Aug 2014
    Posts
    7

    Post Problem in ASP

    please give me your suggestion.

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

  9. #9
    Join Date
    Aug 2014
    Posts
    7

    Post ASP Problem

    Hello Friends,

    my asp pages are working on vps server, but whenever i check from globally by URL it shown internal server error 500

    Please guide me guys..

    what should i do?

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Debug, debug, debug...

    Put the following lines of code in your file, near the top:
    Code:
    Response.Write "I got here!"
    Response.End
    Visit the page.
    If you don't get the 500 error move the two lines of code further down the page.
    Visit the page.
    Repeat.

    When you get the 500 error, start working back up until the page until you can narrow down which section(s) are causing the problem.
    George
    Home | Blog

  11. #11
    Join Date
    Aug 2014
    Posts
    7

    Post ASP Problem

    which file?
    should i put into asp page or .htaccess?

  12. #12
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    ASP page.
    Have you been messing around with .htaccess?
    George
    Home | Blog

  13. #13
    Join Date
    Aug 2014
    Posts
    7

    Post ASP Problem

    No

    i tired with that some time asp pages are working & suddenly they have not work.

    what's going on into my site..

    are you require my mdb file?

  14. #14
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Do not need the MDB file.
    Unfortunately you have to back to debugging 101.

    - Can a basic HTML page be viewed on your site?
    - Can a basic ASP page be viewed on your site?
    George
    Home | Blog

  15. #15
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    unfortunately its soemthiing you have changed since your first error report. now you are getting the 500 HTML error
    see HTTP 500 error message displays instead of ASP error message from 500-100.asp

    its unfortunate as you actually had the error to hand
    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ProductID = ...'.
    the error was reported on that line, but Im guessing you mist have truncated it before reporting it here
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

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