473,836 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Building SQL query when table is two words...

I'm attempting to build a query that involves a table called "All
Students".

The query is simply

sqlString = "SELECT * FROM All Students"

but I get "Syntax error in FROM clause" when I try to run it. I assume
this is because my table is two words. How do I get Access to recognize
it?

Thanks,
Kevin

Nov 14 '05 #1
16 12345
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"
--
Terry Kreft

<au******@quasi ka.net> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
I'm attempting to build a query that involves a table called "All
Students".

The query is simply

sqlString = "SELECT * FROM All Students"

but I get "Syntax error in FROM clause" when I try to run it. I assume
this is because my table is two words. How do I get Access to recognize
it?

Thanks,
Kevin

Nov 14 '05 #2
Br
Terry Kreft wrote:
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"
IMO good practice to always use square brackets around field/tables
names.
<au******@quasi ka.net> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
I'm attempting to build a query that involves a table called "All
Students".

The query is simply

sqlString = "SELECT * FROM All Students"

but I get "Syntax error in FROM clause" when I try to run it. I
assume this is because my table is two words. How do I get Access to
recognize it?

Thanks,
Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 15 '05 #3
I would hold good practice to be to establish a naming convention you stick
to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am liable to
use.
c) use lower case for names with underscore separators for readability.

If your convention involves using square brackets at all times that's fine
but it isn't necessarily good practice.
--
Terry Kreft

"Br@dley" <br**@usenet.or g> wrote in message
news:oZ******** **********@news-server.bigpond. net.au...
Terry Kreft wrote:
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"


IMO good practice to always use square brackets around field/tables names.
<au******@quasi ka.net> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
I'm attempting to build a query that involves a table called "All
Students". <SNIP> Thanks,
Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Nov 15 '05 #4
Br
Terry Kreft wrote:
I would hold good practice to be to establish a naming convention you
stick to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am liable
to use.
c) use lower case for names with underscore separators for
readability.
If your convention involves using square brackets at all times that's
fine but it isn't necessarily good practice.
As I said, my opinion only.

While I agree with the above (I never use spaces) you are assuming the
developer is the one creating the table/etc whereas in real life
developers are often fixing up someone else's work and don't have the
luxury of renaming all the database objects to conform to their personal
standards.
"Br@dley" <br**@usenet.or g> wrote in message
news:oZ******** **********@news-server.bigpond. net.au...
Terry Kreft wrote:
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"


IMO good practice to always use square brackets around field/tables
names.
<au******@quasi ka.net> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
I'm attempting to build a query that involves a table called "All
Students". <SNIP> Thanks,
Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 15 '05 #5
I'm not assuming anything. I'm stating a short version of my own practices.

If you had spent as much time as I have fixing other peoples code you would
probably realise why it is better to espouse real good practices in code
writing/database creation rather than ones which would be irrelevant if the
work had been done properly in the first place.
--
Terry Kreft

"Br@dley" <br**@usenet.or g> wrote in message
news:mK******** **********@news-server.bigpond. net.au...
Terry Kreft wrote:
I would hold good practice to be to establish a naming convention you
stick to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am liable
to use.
c) use lower case for names with underscore separators for
readability.
If your convention involves using square brackets at all times that's
fine but it isn't necessarily good practice.


As I said, my opinion only.

While I agree with the above (I never use spaces) you are assuming the
developer is the one creating the table/etc whereas in real life
developers are often fixing up someone else's work and don't have the
luxury of renaming all the database objects to conform to their personal
standards.
"Br@dley" <br**@usenet.or g> wrote in message
news:oZ******** **********@news-server.bigpond. net.au...
Terry Kreft wrote:
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"

IMO good practice to always use square brackets around field/tables
names.
<au******@quasi ka.net> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
> I'm attempting to build a query that involves a table called "All
> Students".

<SNIP>
> Thanks,
> Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Nov 15 '05 #6
Br
Terry Kreft wrote:
I'm not assuming anything. I'm stating a short version of my own
practices.
If you had spent as much time as I have fixing other peoples code
you...
Another assumption? :)

I've 11+ years experience with Access development. More than enough to
have an idea of what I'm talking about.
would probably realise why it is better to espouse real good
practices in code writing/database creation rather than ones which
would be irrelevant if the work had been done properly in the first
place.

As I said, I agree with the implementation of standards when developing
a database.

However, I stand by my initial point. Most real world jobs that I have
been involved in no-one is there to "espouse" good practice to. The
original 'developer' (I use the term loosely as most aren't real
developers) is long gone and you've been called in to add reporting or
something. Their is usually a tight budget involved that does not allow
for the luxury of redesigning the application to conform to good
practice.
"Br@dley" <br**@usenet.or g> wrote in message
news:mK******** **********@news-server.bigpond. net.au...
Terry Kreft wrote:
I would hold good practice to be to establish a naming convention
you stick to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am
liable to use.
c) use lower case for names with underscore separators for
readability.
If your convention involves using square brackets at all times
that's fine but it isn't necessarily good practice.
As I said, my opinion only.

While I agree with the above (I never use spaces) you are assuming
the developer is the one creating the table/etc whereas in real life
developers are often fixing up someone else's work and don't have the
luxury of renaming all the database objects to conform to their
personal standards.
"Br@dley" <br**@usenet.or g> wrote in message
news:oZ******** **********@news-server.bigpond. net.au...
Terry Kreft wrote:
> Square brackets i.e.
>
> sqlString = "SELECT * FROM [All Students]"

IMO good practice to always use square brackets around field/tables
names.
> <au******@quasi ka.net> wrote in message
> news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
>> I'm attempting to build a query that involves a table called "All
>> Students".
<SNIP>
>> Thanks,
>> Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 16 '05 #7

OK, you seem intent on insisting I said something that I didn't so
discussing the issue with you seems irrelevant.

BYW 11+ years, means to me you are just reaching puberty in your programming
life, so that maybe explains something I hadn't taken into account <g>.

--
Terry Kreft

"Br@dley" <br**@usenet.or g> wrote in message
news:Vs******** **********@news-server.bigpond. net.au...
Terry Kreft wrote:
I'm not assuming anything. I'm stating a short version of my own
practices.
If you had spent as much time as I have fixing other peoples code you...


Another assumption? :)

I've 11+ years experience with Access development. More than enough to
have an idea of what I'm talking about.
would probably realise why it is better to espouse real good
practices in code writing/database creation rather than ones which
would be irrelevant if the work had been done properly in the first
place.

As I said, I agree with the implementation of standards when developing a
database.

However, I stand by my initial point. Most real world jobs that I have
been involved in no-one is there to "espouse" good practice to. The
original 'developer' (I use the term loosely as most aren't real
developers) is long gone and you've been called in to add reporting or
something. Their is usually a tight budget involved that does not allow
for the luxury of redesigning the application to conform to good practice.
"Br@dley" <br**@usenet.or g> wrote in message
news:mK******** **********@news-server.bigpond. net.au...
Terry Kreft wrote:
I would hold good practice to be to establish a naming convention
you stick to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am
liable to use.
c) use lower case for names with underscore separators for
readability.
If your convention involves using square brackets at all times
that's fine but it isn't necessarily good practice. As I said, my opinion only.

While I agree with the above (I never use spaces) you are assuming
the developer is the one creating the table/etc whereas in real life
developers are often fixing up someone else's work and don't have the
luxury of renaming all the database objects to conform to their
personal standards.

"Br@dley" <br**@usenet.or g> wrote in message
news:oZ******** **********@news-server.bigpond. net.au...
> Terry Kreft wrote:
>> Square brackets i.e.
>>
>> sqlString = "SELECT * FROM [All Students]"
>
> IMO good practice to always use square brackets around field/tables
> names.
>> <au******@quasi ka.net> wrote in message
>> news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
>>> I'm attempting to build a query that involves a table called "All
>>> Students".
<SNIP>
>>> Thanks,
>>> Kevin

--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Nov 16 '05 #8
"Br@dley" <br**@usenet.or g> wrote in
news:Vs******** **********@news-server.bigpond. net.au:
However, I stand by my initial point. Most real world jobs that I
have been involved in no-one is there to "espouse" good practice
to. The original 'developer' (I use the term loosely as most
aren't real developers) is long gone and you've been called in to
add reporting or something. Their is usually a tight budget
involved that does not allow for the luxury of redesigning the
application to conform to good practice.


On any projects where I'm brought in to add something to the work of
another "developer, " part of my estimate will include a cleanup
process, which is necessary before I'll agree to take over and
support any alterations to the application. This is a non-negotiable
part of the project (and needs to happn only once).

I can't waste my time repeatedly working around bad naming
conventions, and I refuse to do so. And the client pays me to fix
the things their previous developer did wrong. If they don't want to
pay me to do that, they can hire someone else to do the job.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 17 '05 #9
Br
David W. Fenton wrote:
"Br@dley" <br**@usenet.or g> wrote in
news:Vs******** **********@news-server.bigpond. net.au: <>
.... part of my estimate will include a cleanup
process, which is necessary before I'll agree to take over and
support any alterations to the application. This is a non-negotiable
part of the project (and needs to happn only once).
<>
If they don't want to
pay me to do that, they can hire someone else to do the job.


It's nice if you can afford that luxury.
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7607
by: Bennett Haselton | last post by:
I'm looking for a PHP tutorial that specializes in how to build sites that are based around user logins. i.e. the user logs in on the front page, and are taken to a main login page where fields on the page are populated with values from some server-side database. Ideally, there would be a server-side "user" database table, with fields such as "age", so that you could insert a short tag in the PHP source like: Your age is: <?php ?> ...
2
926
by: Stan | last post by:
Hello all, I'm looking for some hints as to how to use the results of a query in another query. I assume I'm 'thinking' wrong in how to solve this, so I'm hoping someone can clobber me and send me in the right direction. My question is best illustrated by simplified example. I have one table (table A) with a single column called "Word". This table contains 100 records of single words. Another table (table B) contains whole sentences...
22
3076
by: Robert Brown | last post by:
suppose I have the following table: CREATE TABLE (int level, color varchar, length int, width int, height int) It has the following rows 1, "RED", 8, 10, 12 2, NULL, NULL, NULL, 20 3, NULL, 9, 82, 25
4
1999
by: frizzle | last post by:
Hi there, Still building my forum. I have a certain mysql-query i just can't figure out. These are my tables (simplified): categories -> id, description forums -> id, cat_id, description threads -> id, forum_id, date, title, text I suppose each speaks for itself.
13
4008
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate button "Unexpected Error":3251 operation is not supported for this type of object.The demo cd has two databases, one is called inventory and the other just has the tables for the design called inventory data. When you run inventory the database works...
3
6546
by: wsox66 | last post by:
I am new to Access and need some help building a report. I have looked through previous posts on reports but none of them seem to answer my question completely. I am using Access 2003 and I have a database with one table. I have built ten different queries to organize run calculations on the records in the table. The problem is that the queries don't all access the same columns nor do they all return the same number of rows and columns in...
14
2475
bugboy
by: bugboy | last post by:
I'm a beginner at this and am confused... I have three tables: 1. words / wordpk, word 2. definitions / definitionspk and definition 3. associations / wordpk, definitionspk 'words' holds words, 'definition' holds definitions for the words and 'associations' holds the pk associations between words and definitions because words can have many related definitions and definitions can many related words... many to many.
2
6677
by: kilo | last post by:
Hey.. I need someone hwo can help me making my sql table.. I have no php skills. I have payed for a php program that shoud make dictation for people that have some problems reading danish.. with sound and text.. When I'm making the dictation with PHP I'm getting an error like this.: Query failed (SELECT word FROM repository): Table 'test_dig_dk.repository' doesn't exist the first one of the php, that I soud use for makeing the text is.. ...
16
3366
by: OldBirdman | last post by:
I have tables to contain the names of the birds of the world. tGN - Genus scientific (Latin) names Key (PK) autonum Ptr->FA (FK) pointer to key in table=FA Not used in this problem Latin (text) Genus scientific name tSP - Species names Key (PK) autonum
0
9825
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10859
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10602
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9388
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4463
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.