Syntax error in FROM clause?? 
Author Message
 Syntax error in FROM clause??

I am using an ADO data control with an MSFlexGrid to access data from an
access 2000 db using VB6 on NT4.

I am following the instructions from John Connell's WROX book. When I follow
his instructions about setting up the data control and MSFlexGrid for
accessing Biblio.mdb - no problem.  Everything works.  However, Biblio is an
access97 db and I use Jet 3.51 as the provider.  Jet 3.51 doesn't work on my
2000 db, so I use Jet 4.0... and it works, at least the 'test connection'
succeeds.  I also set the RecordSource property of the data control to the
single table on my db.  Then I go to the MSFlexGrid and set the database
property to the data control.  But when I right click on the MSFlexGrid to
retrieve the structure of my database, I receive the
    'Syntax error in FROM clause'
error in a message box that contains a single OK button.

I don't know where this error comes from.  I'm using the adCmdTable as the
RecordSource Command Type, so I don't think that there is any sql involved,
but who knows?...  My Access 2000 db is a single large table (700 kb).

Any suggestions would be appreciated, of course.



Sun, 27 Oct 2002 03:00:00 GMT  
 Syntax error in FROM clause??
Don't know if this helps, but....
Did you recently install any database components (without rebooting)? If so, that may be the entire problem. Bit me once.
Quote:

> I am using an ADO data control with an MSFlexGrid to access data from an
> access 2000 db using VB6 on NT4.

> I am following the instructions from John Connell's WROX book. When I follow
> his instructions about setting up the data control and MSFlexGrid for
> accessing Biblio.mdb - no problem.  Everything works.  However, Biblio is an
> access97 db and I use Jet 3.51 as the provider.  Jet 3.51 doesn't work on my
> 2000 db, so I use Jet 4.0... and it works, at least the 'test connection'
> succeeds.  I also set the RecordSource property of the data control to the
> single table on my db.  Then I go to the MSFlexGrid and set the database
> property to the data control.  But when I right click on the MSFlexGrid to
> retrieve the structure of my database, I receive the
>     'Syntax error in FROM clause'
> error in a message box that contains a single OK button.

> I don't know where this error comes from.  I'm using the adCmdTable as the
> RecordSource Command Type, so I don't think that there is any sql involved,
> but who knows?...  My Access 2000 db is a single large table (700 kb).

> Any suggestions would be appreciated, of course.



Sun, 27 Oct 2002 03:00:00 GMT  
 Syntax error in FROM clause??
Thanks Ken,

I haven't installed any database components, but I did find a solution to my
problem, and I pass it on in case you are interested:
The problem I had was the table I was trying to retrieve the structure from
was named:
    1 table new_two    'the name had spaces in it

It turns out that the RecordSource property of the data control will pick up
the name of the table from the db, but it doesn't recognize spaces for what
they are.  I guess it sees them as delimiters, so it defaults to an sql
statement.  That's why I got the error message; it is looking for sql and
FROM wasn't there.

The work around was to use an adCmdText Command Type and write an sql
    SELECT * FROM [1 table new_two]
in the box offered by VB.
Anyway that worked.
Rick


Quote:
> Don't know if this helps, but....
> Did you recently install any database components (without rebooting)? If

so, that may be the entire problem. Bit me once.
Quote:




Quote:
> > I am using an ADO data control with an MSFlexGrid to access data from an
> > access 2000 db using VB6 on NT4.

> > I am following the instructions from John Connell's WROX book. When I
follow
> > his instructions about setting up the data control and MSFlexGrid for
> > accessing Biblio.mdb - no problem.  Everything works.  However, Biblio
is an
> > access97 db and I use Jet 3.51 as the provider.  Jet 3.51 doesn't work
on my
> > 2000 db, so I use Jet 4.0... and it works, at least the 'test
connection'
> > succeeds.  I also set the RecordSource property of the data control to
the
> > single table on my db.  Then I go to the MSFlexGrid and set the database
> > property to the data control.  But when I right click on the MSFlexGrid
to
> > retrieve the structure of my database, I receive the
> >     'Syntax error in FROM clause'
> > error in a message box that contains a single OK button.

> > I don't know where this error comes from.  I'm using the adCmdTable as
the
> > RecordSource Command Type, so I don't think that there is any sql
involved,
> > but who knows?...  My Access 2000 db is a single large table (700 kb).

> > Any suggestions would be appreciated, of course.



Sun, 27 Oct 2002 03:00:00 GMT  
 
 [ 3 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. Syntax error in FROM clause

5. Help - syntax error in from clause

6. VB Syntax error in FROM Clause

7. ADO "syntax error in FROM clause"

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

9. Syntax error in FROM clause (ADO)

10. Syntax error in FROM clause

11. syntax error in FROM clause pb

12. Syntax error in FROM clause ??????

 

 
Powered by phpBB® Forum Software