473,386 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Column Names

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
4 4247
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

"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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bart Van der Donck | last post by:
Hello, I am using MySQL 4.0. Say that I have a table named "mytable" having a column "ID" and a column "test columnname". When dumping: mysqldump --opt DATABASE -uUSER -hHOST -pPASS >...
2
by: Matthew Cascio | last post by:
My understanding is that using reserved words as column names is allowable as long as they are quoted. I am trying to create a table dynamically with columns defined by the first row of a text...
11
by: Randell D. | last post by:
Folks, I have a table of addresses and a seperate table with contact names - All addresses tie to one or more names - I would like to keep track of the number of names 'belonging' to an address...
1
by: noor | last post by:
Hi I have been working since 2 days to device a method to export sql table into csv format. I have tried using bcp with format option to keep the column names but I'm unable to transfer the file...
10
by: Colleyville Alan | last post by:
I am trying to turn a short and fat (63 columns) table into one that is tall and skinny (7 columns). Basically, I am trying to create a "reverse crosstab" using a looping structure in VBA along...
3
by: PeterZ | last post by:
Hi, In a running C# app with a datagrid control I select all rows in the dataGrid using CTRL-A, I then paste into some other app like notepad or Word but the column headings get left off. Is...
1
by: Larry Bird | last post by:
I've created a AlertDataClass below within the class I have tables and column that I've create. In the AlertDataAccess class I'm trying to insert data into my tables. AlertDataAccess is a Module...
4
by: Scot L. Harris | last post by:
Currently using Postgresql 7.2.4-5.80 with php 4.2.2.-8.0.8 on a redhat 8.0 system. I am writing some php scripts where I want to generate a list of the column names in a particular table that...
2
by: Charleees | last post by:
Hi all, I have a DataGrid with Template Columns..... There are LAbels,Linkbuttons in the Single Row.. I have to set the Constant Column width for those Template Columns in Grid... Wat...
1
by: christianlott1 | last post by:
I want to provide users with an interface to create a custom merge (all in Access, not Word). User will put in a set of brackets ("<>") in a memo field and when they click the merge button it will...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.