Syntax problems in the FROM clause of a sql statement

Results 1 to 4 of 4

Thread: Syntax problems in the FROM clause of a sql statement

  1. #1
    Taylor Ackley Guest

    Default Syntax problems in the FROM clause of a sql statement

    this is my code<BR>&#060;% dim db, ondb<BR>set db = server.CreateObject("ADODB.Connection")<BR>db.Open "update"<BR><BR>set ondb = db.Execute("SELECT * FROM update SORT BY UDate")<BR>%&#062;<BR><BR>this is my error<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR><BR>[Microsoft][ODBC Microsoft Access 97 Driver] Syntax error in FROM clause. <BR><BR>/update_app/update.asp, line 12 <BR><BR>how do I fix this?<BR><BR>Taylor Ackley

  2. #2
    Nathan Pond Guest

    Default RE: Syntax problems in the FROM clause of a sql statement

    I don&#039t know for sure, But I&#039m guessing your problem is one of 2 things:<BR><BR>update is a reserved word in SQL, for updating data in tables. It might not like the fact that you are using it as a table name.<BR><BR>I&#039m not aware of a "SORT BY" in SQL. Just because I&#039m not aware of it doesn&#039t mean it doesn&#039t exists. I always use "ORDER BY" in my statements.<BR><BR>Again, I&#039m not sure about either of these, they are the first places I would start if I had to debug it.<BR><BR>Nathan

  3. #3
    Marco Valdez Guest

    Default RE: Syntax problems in the FROM clause of a sql statement

    Hi Taylor:<BR><BR>do you include adovbs.inc for the constants? if you don&#039t know what this is, then you don&#039t.<BR><BR>anyway, if you do use the contants, try using:<BR><BR>strConnect = "DSN=yourDSNname"<BR><BR>db.Open "update", strConnect, adOpenKeyset, adLockReadOnly, adCmdText<BR><BR>Of course, you would need to change out the constants in the db.Open line, but the last constant, adCmdText allows you to use the FROM clause properly.<BR><BR>thanks,<BR><BR>Marco<BR><BR><BR>

  4. #4
    Néstor Sulú Guest

    Default RE: Syntax problems in the FROM clause of a sql statement

    1) UPDATE is a reserved word for SQL ANSI, you must refer this table closed in "[" "]", i.e.<BR>"SELECT * FROM [UPDATE] WHERE ..."<BR><BR>2)If you are using SQL Server as DBMS, then the error is that the clause for sorting records is ORDER BY instead of SORT BY


Posting Permissions

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