?This SQL statement won't work -- Microsoft.Jet.OLEDB.4.0 has reserved words?

?This SQL statement won't work -- Microsoft.Jet.OLEDB.4.0 has reserved words?

Post by Al Mac » Fri, 21 Apr 2000 04:00:00



I have found that the SQL command

  select * from Descriptors order by Type, Descriptor

will not work when I use the Microsoft.Jet.OLEDB.4.0 provider.  After much
trial and error,  I've found that it fails because one of the fields is
called "Descriptor".  If I change the field name to something else, it works
OK.

Note that this works fine when MSDASQL;Driver={Microsoft Access Driver
(*.mdb)} is the provider.

I also found that naming a table "Index" is a no-no with the jet provider.
Are "Descriptor" and "Index" reserveds word?  If so, where can I find a list
of the other reserved words?

 
 
 

?This SQL statement won't work -- Microsoft.Jet.OLEDB.4.0 has reserved words?

Post by Al Mac » Sat, 22 Apr 2000 04:00:00


I have found that the SQL command

  select * from Descriptors order by Type, Descriptor

will not work when I use the Microsoft.Jet.OLEDB.4.0 provider.  After much
trial and error,  I've found that it fails because one of the fields is
called "Descriptor".  If I change the field name to something else, it works
OK.

Note that this works fine when MSDASQL;Driver={Microsoft Access Driver
(*.mdb)} is the provider.

I also found that naming a table "Index" is a no-no with the jet provider.
Are "Descriptor" and "Index" reserveds word?  If so, where can I find a list
of the other reserved words?

 
 
 

?This SQL statement won't work -- Microsoft.Jet.OLEDB.4.0 has reserved words?

Post by Gabriel Knizni » Sat, 22 Apr 2000 04:00:00


If you use reserved words, enclose them between square brackets. I can't
remember where I saw a list of reserved words, but you can trust your common
sense when choosing names.

Gabriel Kniznik


Quote:> I have found that the SQL command

>   select * from Descriptors order by Type, Descriptor

> will not work when I use the Microsoft.Jet.OLEDB.4.0 provider.  After much
> trial and error,  I've found that it fails because one of the fields is
> called "Descriptor".  If I change the field name to something else, it
works
> OK.

> Note that this works fine when MSDASQL;Driver={Microsoft Access Driver
> (*.mdb)} is the provider.

> I also found that naming a table "Index" is a no-no with the jet provider.
> Are "Descriptor" and "Index" reserveds word?  If so, where can I find a
list
> of the other reserved words?

 
 
 

?This SQL statement won't work -- Microsoft.Jet.OLEDB.4.0 has reserved words?

Post by Al Mac » Sat, 22 Apr 2000 04:00:00


I didn't think that Descriptor would be reserved, but perhaps anything that
starts with DESC (as in DESCENDING) will fail.

The thing that bothers me most is that what fails depends on the provider.
I would prefer more standardization.


> If you use reserved words, enclose them between square brackets. I can't
> remember where I saw a list of reserved words, but you can trust your
common
> sense when choosing names.

> Gabriel Kniznik



> > I have found that the SQL command

> >   select * from Descriptors order by Type, Descriptor

> > will not work when I use the Microsoft.Jet.OLEDB.4.0 provider.  After
much
> > trial and error,  I've found that it fails because one of the fields is
> > called "Descriptor".  If I change the field name to something else, it
> works
> > OK.

> > Note that this works fine when MSDASQL;Driver={Microsoft Access Driver
> > (*.mdb)} is the provider.

> > I also found that naming a table "Index" is a no-no with the jet
provider.
> > Are "Descriptor" and "Index" reserveds word?  If so, where can I find a
> list
> > of the other reserved words?

 
 
 

?This SQL statement won't work -- Microsoft.Jet.OLEDB.4.0 has reserved words?

Post by Russ E. R » Thu, 27 Apr 2000 04:00:00


TYPE is the reserved word in this case I believe. Type it as [Type] in the
Order by clause.
--
Russ E. R.
DMCI-modis
Director, Software Development



Quote:> I have found that the SQL command

>   select * from Descriptors order by Type, Descriptor

> will not work when I use the Microsoft.Jet.OLEDB.4.0 provider.  After much
> trial and error,  I've found that it fails because one of the fields is
> called "Descriptor".  If I change the field name to something else, it
works
> OK.

> Note that this works fine when MSDASQL;Driver={Microsoft Access Driver
> (*.mdb)} is the provider.

> I also found that naming a table "Index" is a no-no with the jet provider.
> Are "Descriptor" and "Index" reserveds word?  If so, where can I find a
list
> of the other reserved words?