Results 1 to 3 of 3

Thread: sql help needed

  1. #1
    Join Date
    May 2004
    Location
    NewYork, USA
    Posts
    175
    Thanks
    25
    Thanked 0 Times in 0 Posts

    Default sql help needed

    Hi guys,

    i am trying to write a script:

    Error is

    Code:
    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ID='.
    /Domains/MyDomain/WWWROOT/admin/dbmod/asp/db_ListSHW.asp, line 50

    line 50 is:
    Code:
    <%
    LookUp=Session("idLookUp")
    Set FIELD = Server.CreateObject("ADODB.Connection")
    field.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("..\..\..\..\db\DB938745_ContactForms.mdb"))
    DEARSQL = "SELECT * FROM WebForms WHERE  ID= " & LookUp
    set WebForms= field.Execute(DEARSQL)
    do while not WebForms.eof 
    %>
    this code was working while ago... I didnt changed anything...

    Whats wrong with it

  2. #2
    Join Date
    Apr 2005
    Location
    Haslemere, Surrey, UK
    Posts
    340
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by HostCan View Post
    Code:
    <%
    LookUp=Session("idLookUp")
    Set FIELD = Server.CreateObject("ADODB.Connection")
    field.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("..\..\..\..\db\DB938745_ContactForms.mdb"))
    DEARSQL = "SELECT * FROM WebForms WHERE  ID= " & LookUp
    set WebForms= field.Execute(DEARSQL)
    do while not WebForms.eof 
    %>
    Firstly, I would check that Session("idLookUp") really does have a value, by adding this code at the top of your script.

    Code:
    Response.write("[" & Session("idLookUp") & "]")
    Response.End
    Then try wrapping the LookUp in quotes for the SQL and see if this works.

    Code:
    DEARSQL = "SELECT * FROM WebForms WHERE  ID= '" & LookUp & "'"
    Alastair
    Alastair - WOWD



  3. #3
    Join Date
    May 2004
    Location
    NewYork, USA
    Posts
    175
    Thanks
    25
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Wise Webs View Post
    Firstly, I would check that Session("idLookUp") really does have a value, by adding this code at the top of your script.
    hi, today I worked on it again and the problem is mistake on session as you stated. Eventually I solved the problem thanks for your help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. CSS help needed
    By schofieldandwhite in forum HTML/CSS/JavaScript
    Replies: 1
    Last Post: 18th November 2006, 05:35 PM
  2. Replies: 2
    Last Post: 2nd August 2006, 03:04 PM
  3. code needed for clock countdown script
    By Space Cowboy in forum PHP
    Replies: 8
    Last Post: 15th June 2006, 01:15 AM
  4. Basic first time website & SQL2005 setup - help needed
    By theonlinecleaningshop in forum Technical Support
    Replies: 6
    Last Post: 5th March 2006, 12:12 PM
  5. Flash Designer/Developer Needed
    By Shiven Rabadia in forum For Sale, Sites and Services
    Replies: 0
    Last Post: 20th October 2005, 01:58 PM

Bookmarks

Posting Permissions

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