473,668 Members | 2,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4266
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***@REMOVEwy ght.com> wrote in message
news:RMaCb.5831 0$bC.6396@clgrp s13...
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***@REMOVEwy ght.com> wrote in message
news:RMaCb.5831 0$bC.6396@clgrp s13...
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***@REMOVEwy ght.com> wrote in message news:<RMaCb.583 10$bC.6396@clgr ps13>...
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******@pcdata sheet.com
www.pcdatasheet.com

"Warren" <wy***@REMOVEwy ght.com> wrote in message
news:RMaCb.5831 0$bC.6396@clgrp s13...
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
3401
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 > myfile.txt
2
12366
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 file I import. Unfortunately, I have no control over the column names and the data provider has chosen to use the word "USE" as a column name. "USE" is a reserved word. To handle this, I tried quoting the word during the CREATE TABLE statement,...
11
4846
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 and have thus included a column in my address table called num_of_contacts. Everytime I add a new contact, I would like to increment the num_of_contacts column in the address table. Is this possible?
1
12201
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 with column names. and also I'm having problems on columns having decimal data. Can any one suggest me how to automate data transfer(by using SP) and retaining column names. Thanks Noor
10
6557
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 with SQL. I'd like to take the name of the column and input it into a descritor field. This isn't the table, but will serve as a better illustration than the real deal. If the table looks like this:
3
4859
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 there any way of including column headings when copying/pasting from a running datagrid to notepad? At this stage it looks like I have to write my own code but would rather not if someone knows how to do it.
1
1807
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 that is trying to insert data into the tables. Within the AlertDataClass is subroutine that init and creates ColumnNames. In invoke the AddDataColumnNames() sub to create the column headers. Why can't I see the column names in my module that I'm...
4
2975
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 the user selects. I could take the brute force method and hard code the column names but then every time I add a new table or modify an existing one I would have to modify the code. What I want is to have a generic function that given the table...
2
10394
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 actually happens is... when the Text size is too big... the column
1
3403
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 grab the fields listed in a tabular subform and merge it with their memo text. I was able to retrieve the code to list the column names of a table. I constructed the code to iterate the tabular subform rows and replace the brackets with the row...
0
8459
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
8367
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8889
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...
0
8790
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8650
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7391
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...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2781
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

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.