Help - syntax error in from clause 
Author Message
 Help - syntax error in from clause

Hey DB wizards

I have ran into the following problem:
if i have the table tbl and the following code

dim tbl as string
dim sqla as string
dim dyna as dynaset
dim mydb as database
tbl= {something}
sqla="SELECT * FROM" & tbl & " WHERE blabla ORDER BY blablalba"
set dyna=mydb.createdynaset(sqla)

If tbl contains any of $,^,&,*,{ etc.

I have an error "Syntax Error in Form Clause"

Nethertheless I can always create dynaset as
set dyna=mydb.creatdynaset(tbl)

I can't found in docs anything prohibited using of spec char in table names
Any idea?

Thanks in Advance
Vitali



Sat, 13 Dec 1997 03:00:00 GMT  
 Help - syntax error in from clause

Quote:
>Hey DB wizards
>I have ran into the following problem:
>if i have the table tbl and the following code
>dim tbl as string
>dim sqla as string
>dim dyna as dynaset
>dim mydb as database
>tbl= {something}
>sqla="SELECT * FROM" & tbl & " WHERE blabla ORDER BY blablalba"
>set dyna=mydb.createdynaset(sqla)
>If tbl contains any of $,^,&,*,{ etc.
>I have an error "Syntax Error in Form Clause"
>Nethertheless I can always create dynaset as
>set dyna=mydb.creatdynaset(tbl)
>I can't found in docs anything prohibited using of spec char in table names
>Any idea?

Try putting brackets around the variable:
        "SELECT * FROM [" & tbl & "]........"

Scott.

   ______
  /     / \\\\\\\\\\\\\\\\\\\/////////////////////
 /  ___/__             Scott Kostakos
/__/__/                Only Solutions

       /   There are no problems, only solutions
 _____/  ////////////////////\\\\\\\\\\\\\\\\\\\\\



Sat, 13 Dec 1997 03:00:00 GMT  
 Help - syntax error in from clause

Quote:

>Subject: Help - syntax error in from clause
>Keywords:  SQL, From
>Date: Tue, 27 Jun 1995 10:24:00 GMT
>Hey DB wizards
>I have ran into the following problem:
>if i have the table tbl and the following code
>dim tbl as string
>dim sqla as string
>dim dyna as dynaset
>dim mydb as database
>tbl= {something}
>sqla="SELECT * FROM" & tbl & " WHERE blabla ORDER BY blablalba"
>set dyna=mydb.createdynaset(sqla)
>If tbl contains any of $,^,&,*,{ etc.
>I have an error "Syntax Error in Form Clause"
>Nethertheless I can always create dynaset as
>set dyna=mydb.creatdynaset(tbl)
>I can't found in docs anything prohibited using of spec char in table names
>Any idea?

Just a shot in the dark... but I was just playing around with ANSI-SQL a
couple of hours ago. There I ran into the problem of Wildcards in ANSI-SQL:
  It's NOT *, ? et.c....  but %, _, $, and some others...

What I'm getting at is that maybe Access TRY to resemle ANSI-SQL when you use
SQL-strings, but doesn't care when you use VB/Access-specific methods?????

Dag.



Sat, 13 Dec 1997 03:00:00 GMT  
 Help - syntax error in from clause

Quote:
>Hey DB wizards
>I have ran into the following problem:
>if i have the table tbl and the following code
>dim tbl as string
>dim sqla as string
>dim dyna as dynaset
>dim mydb as database
>tbl= {something}
>sqla="SELECT * FROM" & tbl & " WHERE blabla ORDER BY blablalba"
>set dyna=mydb.createdynaset(sqla)
>If tbl contains any of $,^,&,*,{ etc.
>I have an error "Syntax Error in Form Clause"
>Nethertheless I can always create dynaset as
>set dyna=mydb.creatdynaset(tbl)
>I can't found in docs anything prohibited using of spec char in table names
>Any idea?

try this
sqla="SELECT * FROM [" & tbl & "]  WHERE blabla ORDER BY blablalba"


Sun, 14 Dec 1997 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error-2147217900, Syntax error in FROM clause

2. Error 3131 Syntax error in FROM clause - using SQL accessing external ODBC problem

3. Error 3131 Syntax error in FROM clause - using SQL accessing external ODBC problem

4. HELP / HELP / syntax SQL / 'LIKE' clause

5. SQL Syntax error in ORDER BY clause.(-2147217900)

6. Syntax error in FROM clause

7. Syntax error in FROM clause??

8. VB Syntax error in FROM Clause

9. ADO "syntax error in FROM clause"

10. SQL Syntax error in FROM Clause...but WHY?

11. FROM clause syntax error with sensible SQL query to Excel database

12. Syntax error in FROM clause (ADO)

 

 
Powered by phpBB® Forum Software