By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,136 Members | 1,087 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,136 IT Pros & Developers. It's quick & easy.

Column Names

P: n/a
I am trying to capture some data from a MS Access DB which was created and
populated by a VB program I did not write. I can grab all the data but I
need to grab certain columns only, problem is the column names have spaces
in them.

IE

Cabinet Height, Cabinet Depth, Cabinet Width.

When I create the SQL statement during run time I tried the following from
my C++ program

Select Cabinet Height, Cabinet Depth, Cabinet Width From tbName;

Select Cabinet_Height, Cabinet_Depth, Cabinet_Width From tbName;

Neither worked, the only thing that seems to work is the wildcard *.

Do the columns come out of the Access DB as an Array

Select column[10], column[11], column[12] From tbName;

Or is there another way to call each column from the database that I need
and not all of the columns?
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
TC
Select Cabinet Height, ...
is no good (as you've found).

Select [Cabinet Height], ...
is what you need in Jet SQL.

HTH,
TC
"Warren" <wy***@REMOVEwyght.com> wrote in message
news:RMaCb.58310$bC.6396@clgrps13...
I am trying to capture some data from a MS Access DB which was created and
populated by a VB program I did not write. I can grab all the data but I
need to grab certain columns only, problem is the column names have spaces
in them.

IE

Cabinet Height, Cabinet Depth, Cabinet Width.

When I create the SQL statement during run time I tried the following from
my C++ program

Select Cabinet Height, Cabinet Depth, Cabinet Width From tbName;

Select Cabinet_Height, Cabinet_Depth, Cabinet_Width From tbName;

Neither worked, the only thing that seems to work is the wildcard *.

Do the columns come out of the Access DB as an Array

Select column[10], column[11], column[12] From tbName;

Or is there another way to call each column from the database that I need
and not all of the columns?

Nov 12 '05 #2

P: n/a

"TC" <a@b.c.d> wrote in message news:1071207293.632484@teuthos...
Select Cabinet Height, ...
is no good (as you've found).

Select [Cabinet Height], ...
is what you need in Jet SQL.

HTH,
TC
"Warren" <wy***@REMOVEwyght.com> wrote in message
news:RMaCb.58310$bC.6396@clgrps13...
I am trying to capture some data from a MS Access DB which was created and populated by a VB program I did not write. I can grab all the data but I need to grab certain columns only, problem is the column names have spaces in them.

IE

Cabinet Height, Cabinet Depth, Cabinet Width.

When I create the SQL statement during run time I tried the following from my C++ program

Select Cabinet Height, Cabinet Depth, Cabinet Width From tbName;

Select Cabinet_Height, Cabinet_Depth, Cabinet_Width From tbName;

Neither worked, the only thing that seems to work is the wildcard *.

Do the columns come out of the Access DB as an Array

Select column[10], column[11], column[12] From tbName;

Or is there another way to call each column from the database that I need and not all of the columns?


Nov 12 '05 #3

P: n/a
"Warren" <wy***@REMOVEwyght.com> wrote in message news:<RMaCb.58310$bC.6396@clgrps13>...
I am trying to capture some data from a MS Access DB which was created and
populated by a VB program I did not write. I can grab all the data but I
need to grab certain columns only, problem is the column names have spaces
in them.

IE

Cabinet Height, Cabinet Depth, Cabinet Width.

When I create the SQL statement during run time I tried the following from
my C++ program

Select Cabinet Height, Cabinet Depth, Cabinet Width From tbName;

Select Cabinet_Height, Cabinet_Depth, Cabinet_Width From tbName;

Neither worked, the only thing that seems to work is the wildcard *.

Do the columns come out of the Access DB as an Array

Select column[10], column[11], column[12] From tbName;

Or is there another way to call each column from the database that I need
and not all of the columns?


Put the column names within square brackets:

Select [Cabinet Height], [Cabinet Depth], [Cabinet Width] From tbName;

Edward
--
The reading group's reading group:
http://www.bookgroup.org.uk
Nov 12 '05 #4

P: n/a
You need to enclose the clumn names in square brackets in your Select statement.
Select [Cabinet Height], [Cabinet Depth], [Cabinet Width] From tbName;
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Warren" <wy***@REMOVEwyght.com> wrote in message
news:RMaCb.58310$bC.6396@clgrps13...
I am trying to capture some data from a MS Access DB which was created and
populated by a VB program I did not write. I can grab all the data but I
need to grab certain columns only, problem is the column names have spaces
in them.

IE

Cabinet Height, Cabinet Depth, Cabinet Width.

When I create the SQL statement during run time I tried the following from
my C++ program

Select Cabinet Height, Cabinet Depth, Cabinet Width From tbName;

Select Cabinet_Height, Cabinet_Depth, Cabinet_Width From tbName;

Neither worked, the only thing that seems to work is the wildcard *.

Do the columns come out of the Access DB as an Array

Select column[10], column[11], column[12] From tbName;

Or is there another way to call each column from the database that I need
and not all of the columns?

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.