Results 1 to 5 of 5

Thread: Syntax Error

  1. #1
    J Williams Guest

    Syntax Error

    I am trying to query ID (Number Field), UserID (Text Field), Password (Text Field) and I continue to receive a syntax error.
    Is there something that I am doing wrong?

    My code:

    <body>
    <%
    Set MyDb=Server.CreateObject(&#34;ASPdb.Pro&#34 &#39;Create the ASP-db object
    MyDb.dbQuickProps=&#34;2071;StudentDatabase1;;both ;4,both&#34; &#39;Set its std properties
    MyDb.dbSQL = &#34;SELECT * from Userdb WHERE ID=&#34; & Request (&#34;ID&#34 & &#34; AND UserID=&#39;&#34; & Request (&#34;UserID&#34 & &#34;&#39; AND Password = &#39;&#34; & Request (&#34;Password&#34 & &#34;&#39;&#34;
    MyDb.dbNavigationItem=&#34;filter, Next, Prev&#34;
    MyDb.dbNavigation=&#34;Both&#34;
    MyDb.dbUnit = 8
    MyDb.dbgridDisplayFlds= &#34;0,1,2,3,4&#34;
    MyDb.dbStatusBar=True
    MyDb.dbRecordCount=5000
    MyDb.dbGridInc=50
    MyDb.ASPdbPro &#39;Call ASPdb to do its magic!

    %>

    Your help is greatly appreciated.

  2. #2
    J Williams Guest

    Syntax Error (reply)

    John,
    I made the changes you suggested and I get the same error message:

    Platform
    GridInc before QP=50
    DBType=ACCESS
    UserQstr:
    Main: Q=..U=..V=..W=..UE=..US=
    Main: Not alive
    New session: SQL=SELECT * from Userdb WHERE ID= AND UserID=&#39;&#39; AND Password=&#39;&#39;
    Connection=StudentDatabase1
    Alive, Get Connection: NewSession=True/True
    Get_Connection: New connection: StudentDatabase1
    Main: New session
    Regular Color - #ffffff/#ffffff/#009900/#006600///
    Grid: Entering
    Show Grid: SX, mode, SQL=_8/grid/SELECT * from Userdb WHERE ID= AND UserID=&#39;&#39;
    AND Password=&#39;&#39;
    mySQL in Get_OrderBY=SELECT * from Userdb WHERE ID= AND UserID=&#39;&#39; AND
    Password=&#39;&#39;
    tail,p1=/61
    heads=SELECT * from Userdb WHERE ID= AND UserID=&#39;&#39; AND Password=&#39;&#39;/
    Show Grid: Sort Name V=
    Grid: mySQL SELECT * from Userdb WHERE ID= AND UserID=&#39;&#39; AND Password=&#39;&#39;
    Show_Gridagesize,RScount,Gridinc=50/0/50
    PT=GridPtr/Pagesize/FormPtr=0/50/0
    PT right before move = 0
    Grid SQL=SELECT * from Userdb WHERE ID= AND UserID=&#39;&#39; AND Password=&#39;&#39;
    Get_RS: Entering mode=both
    Begin Setfilterinsql, filter=SELECT * from Userdb WHERE ID= AND UserID=&#39;&#39; AND
    Password=&#39;&#39;/
    Get_RS_OPEN: Entering GET_RS_OPEN
    Get_RS_OPEN: mySQL in memory=SELECT * from Userdb WHERE ID= AND UserID=&#39;&#39;
    AND Password=&#39;&#39;
    Get_RS_OPEN: High speed TOP
    TOPSQL=SELECT TOP 50 * from Userdb WHERE ID= AND UserID=&#39;&#39; AND Password=&#39;&#39;
    Get_RS_OPEN: Before Reset ROWCOUNT
    Into ROWCOUNT
    Get_RS_OPEN: SQL=SELECT TOP 50 * from Userdb WHERE ID= AND UserID=&#39;&#39; AND
    Password=&#39;&#39;

    Microsoft OLE DB Provider for ODBC Drivers error &#39;80040e14&#39;

    [Microsoft][ODBC Microsoft Access 97 Driver] Syntax error (missing operator) in query expression &#39;ID=
    AND UserID=&#39;&#39; AND Password=&#39;&#39;&#39;.

    /e_port/TestEdit.asp, line 23


    <%
    Set MyDb=Server.CreateObject(&#34;ASPdb.Pro&#34
    Mydb.dbDSN=&#34;StudentDatabase1&#34;
    MyDb.dbColor = &#34;7,auto&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbSQL = &#34;SELECT * from Userdb WHERE ID=&#34; & Request (&#34;ID&#34 & &#34; AND UserID=&#39;&#34; & Request (&#34;UserID&#34 & &#34;&#39; AND Password=&#39;&#34; & Request (&#34;Password&#34 & &#34;&#39;&#34;
    MyDb.dbNavigationItem=&#34;filter, Next, Prev&#34;
    MyDb.dbNavigation=&#34;Both&#34;
    MyDb.dbUnit = 8
    MyDb.dbgridDisplayFlds= &#34;0,1,2,3,4&#34;
    MyDb.dbStatusBar=True
    MyDb.dbRecordCount=5000
    MyDb.dbGridInc=50
    MyDb.dbDebug=True
    MyDb.ASPdbPro

    %>





    On 3/1/99 8:13:37 AM, John wrote:
    > Hi,

    First thing is that I think you have a syntax in your dbQuickProps
    > property. You have &#34;both;4,both&#34; in there. Do you mean
    > &#34;both;4,auto&#34; ?


    Second, if this doesn&#39;t work, skip the
    > quickprops and put each property on a line by itself (dbUnit, dbMDB, dbSQL,
    > dbMode, dbColor).

    Third, you say you get a syntax error. Print out the
    > error message, and also turn on debugging (MyDb.dbDebug=true). This may
    > help point out the error.

    Thanks,
    John

    On 2/26/99 4:49:37 PM, J
    > Williams wrote:
    > I am trying to query ID (Number Field), UserID (Text
    > Field), Password (Text
    > Field) and I continue to receive a syntax error.
    >
    Is there something that
    > I am doing wrong?

    My
    > code:

    <body>
    <%
    Set
    > MyDb=Server.CreateObject(&#34;ASPdb.Pro&#34
    >
    > &#39;Create the ASP-db object

    >
    > MyDb.dbQuickProps=&#34;2071;StudentDatabase1;;both ;4,both&#34; &#39;Set
    >
    > its std properties
    MyDb.dbSQL = &#34;SELECT * from Userdb WHERE
    >
    > ID=&#34; & Request (&#34;ID&#34 & &#34; AND UserID=&#39;&#34; &
    > Request
    > (&#34;UserID&#34 & &#34;&#39; AND Password = &#39;&#34; &
    > Request
    > (&#34;Password&#34 & &#34;&#39;&#34;
    >
    MyDb.dbNavigationItem=&#34;filter,
    > Next, Prev&#34;

    > MyDb.dbNavigation=&#34;Both&#34;

    > MyDb.dbUnit = 8

    > MyDb.dbgridDisplayFlds= &#34;0,1,2,3,4&#34;

    >
    > MyDb.dbStatusBar=True
    MyDb.dbRecordCount=5000
    >
    >
    MyDb.dbGridInc=50
    MyDb.ASPdbPro
    >
    > &#39;Call ASPdb to do its magic!

    >
    >
    %>

    Your help is greatly appreciated.

  3. #3
    John Guest

    Syntax Error (reply)

    The problem&#39;s pretty clear once you look at the dbSQL you&#39;re creating. Apparently, Request(&#34;ID&#34 is coming back BLANK. Look at your SQL:


    On 3/1/99 11:10:14 AM, J Williams wrote:
    > John,
    I made the changes you suggested and I get the same error
    > message:

    SQL=SELECT TOP 50 * from Userdb WHERE ID= AND UserID=&#39;&#39; AND Password=&#39;&#39;

    There&#39;s nothing there for ID= ! It should be ID=&#39;&#39; or something right?
    Maybe you should put the value in a variable and if it&#39;s empty, set it to zero or something?

    I.E.

    myID = Request(&#34;ID&#34
    If MyID = &#34;&#34; then MyID = 0

    Then user MyID in your SELECT statement.

    Good luck,
    John


    Platform
    GridInc before QP=50
    DBType=ACCESS
    UserQstr:
    >
    Main: Q=..U=..V=..W=..UE=..US=
    Main: Not alive
    New session: SQL=SELECT
    > * from Userdb WHERE ID= AND UserID=&#39;&#39; AND
    > Password=&#39;&#39;
    Connection=StudentDatabase1
    Alive, Get Connection:
    > NewSession=True/True
    Get_Connection: New connection:
    > StudentDatabase1
    Main: New session
    Regular Color -
    > #ffffff/#ffffff/#009900/#006600///
    Grid: Entering
    Show Grid: SX, mode,
    > SQL=_8/grid/SELECT * from Userdb WHERE ID= AND UserID=&#39;&#39;
    AND
    > Password=&#39;&#39;
    mySQL in Get_OrderBY=SELECT * from Userdb WHERE ID=
    > AND UserID=&#39;&#39; AND
    Password=&#39;&#39;
    tail,p1=/61
    heads=SELECT *
    > from Userdb WHERE ID= AND UserID=&#39;&#39; AND Password=&#39;&#39;/
    Show
    > Grid: Sort Name V=
    Grid: mySQL SELECT * from Userdb WHERE ID= AND
    > UserID=&#39;&#39; AND
    > Password=&#39;&#39;
    Show_Gridagesize,RScount,Gridinc=50/0/50
    PT=GridPtr/
    > Pagesize/FormPtr=0/50/0
    PT right before move = 0
    Grid SQL=SELECT * from
    > Userdb WHERE ID= AND UserID=&#39;&#39; AND Password=&#39;&#39;
    Get_RS:
    > Entering mode=both
    Begin Setfilterinsql, filter=SELECT * from Userdb WHERE
    > ID= AND UserID=&#39;&#39; AND
    Password=&#39;&#39;/
    Get_RS_OPEN: Entering
    > GET_RS_OPEN
    Get_RS_OPEN: mySQL in memory=SELECT * from Userdb WHERE ID=
    > AND UserID=&#39;&#39;
    AND Password=&#39;&#39;
    Get_RS_OPEN: High speed
    > TOP
    TOPSQL=SELECT TOP 50 * from Userdb WHERE ID= AND UserID=&#39;&#39; AND
    > Password=&#39;&#39;
    Get_RS_OPEN: Before Reset ROWCOUNT
    Into
    > ROWCOUNT
    Get_RS_OPEN: SQL=SELECT TOP 50 * from Userdb WHERE ID= AND
    > UserID=&#39;&#39; AND
    Password=&#39;&#39;

    Microsoft OLE DB Provider for
    > ODBC Drivers error &#39;80040e14&#39;

    [Microsoft][ODBC Microsoft Access
    > 97 Driver] Syntax error (missing operator) in query expression
    > &#39;ID=
    AND UserID=&#39;&#39; AND Password=&#39;&#39;&#39;.
    >

    /e_port/TestEdit.asp, line 23


    <%
    Set
    > MyDb=Server.CreateObject(&#34;ASPdb.Pro&#34

    > Mydb.dbDSN=&#34;StudentDatabase1&#34;
    MyDb.dbColor =
    > &#34;7,auto&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbSQL =
    > &#34;SELECT * from Userdb WHERE ID=&#34; & Request (&#34;ID&#34 & &#34;
    > AND UserID=&#39;&#34; & Request (&#34;UserID&#34 & &#34;&#39; AND
    > Password=&#39;&#34; & Request (&#34;Password&#34 & &#34;&#39;&#34;

    > MyDb.dbNavigationItem=&#34;filter, Next, Prev&#34;

    > MyDb.dbNavigation=&#34;Both&#34;
    MyDb.dbUnit = 8

    > MyDb.dbgridDisplayFlds= &#34;0,1,2,3,4&#34;
    MyDb.dbStatusBar=True

    > MyDb.dbRecordCount=5000

    > MyDb.dbGridInc=50
    MyDb.dbDebug=True
    MyDb.ASPdbPro
    >

    %>





    On 3/1/99
    > 8:13:37 AM, John wrote:
    > Hi,

    First thing is that I think you have a
    > syntax in your dbQuickProps
    > property. You have &#34;both;4,both&#34;
    > in there. Do you mean
    > &#34;both;4,auto&#34; ?


    Second, if this
    > doesn&#39;t work, skip the
    > quickprops and put each property on a line
    > by itself (dbUnit, dbMDB, dbSQL,
    > dbMode, dbColor).

    Third, you say
    > you get a syntax error. Print out the
    > error message, and also turn on
    > debugging (MyDb.dbDebug=true). This may
    > help point out the
    > error.

    Thanks,
    John

    On 2/26/99 4:49:37 PM, J
    > Williams wrote:
    >
    > I am trying to query ID (Number Field), UserID (Text
    > Field), Password
    > (Text
    > Field) and I continue to receive a syntax error.
    >
    Is there
    > something that
    > I am doing wrong?

    My
    > code:

    <body>
    <%
    Set
    >
    > MyDb=Server.CreateObject(&#34;ASPdb.Pro&#34
    >
    >
    > &#39;Create the ASP-db object

    >
    >
    > MyDb.dbQuickProps=&#34;2071;StudentDatabase1;;both ;4,both&#34; &#39;Set
    >
    >
    > its std properties
    MyDb.dbSQL = &#34;SELECT * from Userdb
    > WHERE
    >
    > ID=&#34; & Request (&#34;ID&#34 & &#34; AND
    > UserID=&#39;&#34; &
    > Request
    > (&#34;UserID&#34 & &#34;&#39; AND
    > Password = &#39;&#34; &
    > Request
    > (&#34;Password&#34 &
    > &#34;&#39;&#34;
    >
    MyDb.dbNavigationItem=&#34;filter,
    > Next,
    > Prev&#34;

    > MyDb.dbNavigation=&#34;Both&#34;

    >
    > MyDb.dbUnit = 8

    > MyDb.dbgridDisplayFlds= &#34;0,1,2,3,4&#34;

    >
    >
    > MyDb.dbStatusBar=True
    MyDb.dbRecordCount=5000
    >
    >
    >
    MyDb.dbGridInc=50

    > MyDb.ASPdbPro
    >
    >
    > &#39;Call ASPdb to do its magic!

    >
    >
    %>

    Your help is
    > greatly appreciated.

  4. #4
    J Williams Guest

    Syntax Error (reply)

    John,

    Once again, I have tried the suggestion and no luck. Would it have
    to do anything with ID being an autonumber?

    Here is the code I posted again:

    <body>
    <%
    MyID = Request(&#34;ID&#34
    If MyID = &#34;&#34; then MyID = 0
    %>
    <%
    Set MyDb=Server.CreateObject(&#34;ASPdb.Pro&#34
    Mydb.dbDSN=&#34;StudentDatabase1&#34;
    MyDb.dbColor = &#34;7,auto&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbSQL = &#34;SELECT * from Userdb WHERE myid=&#34; & Request (&#34;myid&#34 & &#34; AND UserID=&#39;&#34; & Request (&#34;UserID&#34 & &#34;&#39; AND Password=&#39;&#34; & Request (&#34;Password&#34 & &#34;&#39;&#34;
    MyDb.dbNavigationItem=&#34;filter, Next, Prev&#34;
    MyDb.dbNavigation=&#34;Both&#34;
    MyDb.dbUnit = 8
    MyDb.dbgridDisplayFlds= &#34;0,1,2,3,4&#34;
    MyDb.dbStatusBar=True
    MyDb.dbRecordCount=5000
    MyDb.dbDebug=True
    MyDb.ASPdbPro

    %>

    <form method=&#34;get&#34; action=&#34;TestEdit.asp&#34; onsubmit=&#34;return FrontPage_Form1_Validator(this)&#34;
    name=&#34;FrontPage_Form1&#34;>
    <p>ID&nbsp; <!--webbot bot=&#34;Validation&#34; startspan S-Data-Type=&#34;Number&#34;
    S-Number-Separators=&#34;,.&#34; --><!--webbot bot=&#34;Validation&#34; endspan --><input type=&#34;text&#34;
    name=&#34;ID&#34; size=&#34;20&#34; value=&#34;<%=TheValue(&#34;ID&#34%>&#34;></p>
    <p>UserID&nbsp; <input type=&#34;text&#34; name=&#34;UserID&#34; size=&#34;20&#34;></p>
    <p>Password: <input type=&#34;password&#34; name=&#34;Password&#34; size=&#34;20&#34;></p>
    <p><input type=&#34;submit&#34; value=&#34;Submit&#34; name=&#34;B1&#34;><input type=&#34;reset&#34; value=&#34;Reset&#34;
    name=&#34;B2&#34;></p>
    <p>&nbsp;</p>
    </form>
    </body>

  5. #5
    J Williams Guest

    Syntax Error (reply)

    John
    I think I may have found my problem. I had the form submitting to itself and I change it by making a seperate form that submitts to the asp page. Now everything works out. I was starting to think I was just loosing it. Should this make that much of a difference?

Posting Permissions

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