PC Review


Reply
 
 
George Stevenson
Guest
Posts: n/a
 
      3rd Jul 2004
How would you go about accessing all of the fields in a database record with
a single statement so that I could copy the record into another database
without needing to know what fields are defined?

I'm interested in backing up database tables from an ODBC source into a
local table without having to reference each individual field in a record.
I want to be able to reference the entire record at once.


 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      4th Jul 2004
SELECT * FROM MyTable will return all fields.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"George Stevenson" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> How would you go about accessing all of the fields in a database record

with
> a single statement so that I could copy the record into another database
> without needing to know what fields are defined?
>
> I'm interested in backing up database tables from an ODBC source into a
> local table without having to reference each individual field in a record.
> I want to be able to reference the entire record at once.
>
>



 
Reply With Quote
 
George Stevenson
Guest
Posts: n/a
 
      4th Jul 2004
and can I reference * to move all fields to a different table?

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:ut5p$(E-Mail Removed)...
> SELECT * FROM MyTable will return all fields.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "George Stevenson" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > How would you go about accessing all of the fields in a database record

> with
> > a single statement so that I could copy the record into another database
> > without needing to know what fields are defined?
> >
> > I'm interested in backing up database tables from an ODBC source into a
> > local table without having to reference each individual field in a

record.
> > I want to be able to reference the entire record at once.
> >
> >

>
>



 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      4th Jul 2004
INSERT INTO Table2
SELECT * FROM Table1

assuming Table2 has the exact same columns as Table1.

If what you're looking for is a generic ability to do this, there is no
silver bullet. You'll need to ensure that the two databases are set up
consistently.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"George Stevenson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> and can I reference * to move all fields to a different table?
>
> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
> news:ut5p$(E-Mail Removed)...
> > SELECT * FROM MyTable will return all fields.
> >
> >
> > "George Stevenson" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > > How would you go about accessing all of the fields in a database

record
> > with
> > > a single statement so that I could copy the record into another

database
> > > without needing to know what fields are defined?
> > >
> > > I'm interested in backing up database tables from an ODBC source into

a
> > > local table without having to reference each individual field in a

> record.
> > > I want to be able to reference the entire record at once.



 
Reply With Quote
 
Peter R. Fletcher
Guest
Posts: n/a
 
      4th Jul 2004
If you really want to do it "without needing to know what fields are
defined", the approach that Douglas outlined wil not help you - as he
notes, it only works when the logical structures ot the source and
destination tables are identical (which implies that they are known!),
and even then you will have problems if there is an Autonumber field
in the Tables. To do literally what you are asking requires that you
programmatically create a new Table and add a field corresponding to
each field in the old table (you can do this "automatically" with a
For Each fld in tblOld .... Loop structure). Only after doing that can
you populate the new Table. There is probably an easier way of doing
what you ultimately want to do.

On Sat, 3 Jul 2004 18:34:32 -0400, "George Stevenson"
<(E-Mail Removed)> wrote:

>How would you go about accessing all of the fields in a database record with
>a single statement so that I could copy the record into another database
>without needing to know what fields are defined?
>
>I'm interested in backing up database tables from an ODBC source into a
>local table without having to reference each individual field in a record.
>I want to be able to reference the entire record at once.
>



Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: fields names do not show in excel 2007 pivot table fields list Shane Devenshire Microsoft Excel New Users 0 1st Dec 2008 08:15 AM
How to convert text fields to numeric fields without losing data in text fields. Frank Microsoft Access Form Coding 24 19th Jan 2008 11:22 AM
How to move fields in custom form to "user-defined fields in folde austex Microsoft Outlook Contacts 0 9th Jan 2008 11:51 PM
MS ACCESS : Auto rearrange Fields Or Hide Fields in DataSheet based on criteria rpatil Introductions 0 17th May 2007 09:55 PM
Outlook Contacts - Converting User-defined Item fields to Folder fields richy240@gmail.com Microsoft Outlook Contacts 1 29th Sep 2006 09:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:56 AM.