Writing Table Data Out To A File 
Author Message
 Writing Table Data Out To A File

Alright, I totally overlooked something in an application I'm writing.
What I need to know is how to write all the data in a table out to a
file so that it can be loaded back into the table in the future.
However, I'm a somewhat pseudo-newfy with VB/VBA (I'm mostly a
Java/PHP/C based languages kinda guy)...  anybody got any ideas on what
I should look into (btw:  I currently have no books and no money... so
online references would be great, or if you just wanna tell me the
answer. =)

-ryan



Sat, 23 Aug 2003 04:22:31 GMT  
 Writing Table Data Out To A File
You can use the TransferText method (see the online help) to export
to/import from a text file.  The only hitch I know about is that
TransferText tends to round floating-point fields to two decimals, possibly
losing significant data.  If this is a problem, you can first create a query
that formats the problem fields into text expressions with the desired
degree of precision, and then export that query.  On import, you should be
able to import directly to your table.

You can also transfer data to/from other formats, such as another Access
.mdb file, an Excel spreadsheet, and so on.  It's in the online help.
--

Dirk Goldgar
(to reply via email, remove NOSPAM from address)

Quote:

>Alright, I totally overlooked something in an application I'm writing.
>What I need to know is how to write all the data in a table out to a
>file so that it can be loaded back into the table in the future.
>However, I'm a somewhat pseudo-newfy with VB/VBA (I'm mostly a
>Java/PHP/C based languages kinda guy)...  anybody got any ideas on what
>I should look into (btw:  I currently have no books and no money... so
>online references would be great, or if you just wanna tell me the
>answer. =)

>-ryan



Sat, 23 Aug 2003 04:46:54 GMT  
 Writing Table Data Out To A File
So far so good man.  Thanks for the advice.  Quick question though:  Is there a
way to NOT supply the file name so that the user can specify the file name and
where on the network he wishes to save it?

-ryan

Quote:

> You can use the TransferText method (see the online help) to export
> to/import from a text file.  The only hitch I know about is that
> TransferText tends to round floating-point fields to two decimals, possibly
> losing significant data.  If this is a problem, you can first create a query
> that formats the problem fields into text expressions with the desired
> degree of precision, and then export that query.  On import, you should be
> able to import directly to your table.

> You can also transfer data to/from other formats, such as another Access
> .mdb file, an Excel spreadsheet, and so on.  It's in the online help.
> --

> Dirk Goldgar
> (to reply via email, remove NOSPAM from address)


> >Alright, I totally overlooked something in an application I'm writing.
> >What I need to know is how to write all the data in a table out to a
> >file so that it can be loaded back into the table in the future.
> >However, I'm a somewhat pseudo-newfy with VB/VBA (I'm mostly a
> >Java/PHP/C based languages kinda guy)...  anybody got any ideas on what
> >I should look into (btw:  I currently have no books and no money... so
> >online references would be great, or if you just wanna tell me the
> >answer. =)

> >-ryan



Sat, 23 Aug 2003 05:12:39 GMT  
 Writing Table Data Out To A File
Your best bet is to get the file name from the user first, store it in a
variable, and pass that to the TransferText method.  If you want to use the
common Windows File Save dialog to get the name and path from the user, see
this link:

    www.mvps.org/access/api0001.htm

Note:  it's possible I have got the wrong filename in the above link, as I
keyed it from memory, but if you start with www.mvps.org/access, you should
be able to find it.

--

Dirk Goldgar
(to reply via email, remove NOSPAM from address)

Quote:

>So far so good man.  Thanks for the advice.  Quick question though:  Is
there a
>way to NOT supply the file name so that the user can specify the file name
and
>where on the network he wishes to save it?

>-ryan


>> You can use the TransferText method (see the online help) to export
>> to/import from a text file.  The only hitch I know about is that
>> TransferText tends to round floating-point fields to two decimals,
possibly
>> losing significant data.  If this is a problem, you can first create a
query
>> that formats the problem fields into text expressions with the desired
>> degree of precision, and then export that query.  On import, you should
be
>> able to import directly to your table.

>> You can also transfer data to/from other formats, such as another Access
>> .mdb file, an Excel spreadsheet, and so on.  It's in the online help.
>> --

>> Dirk Goldgar
>> (to reply via email, remove NOSPAM from address)


>> >Alright, I totally overlooked something in an application I'm writing.
>> >What I need to know is how to write all the data in a table out to a
>> >file so that it can be loaded back into the table in the future.
>> >However, I'm a somewhat pseudo-newfy with VB/VBA (I'm mostly a
>> >Java/PHP/C based languages kinda guy)...  anybody got any ideas on what
>> >I should look into (btw:  I currently have no books and no money... so
>> >online references would be great, or if you just wanna tell me the
>> >answer. =)

>> >-ryan



Sat, 23 Aug 2003 05:17:16 GMT  
 Writing Table Data Out To A File
Got everything working beautifully now.  Just wanted to thank you a million
thanks and I forward a thousand blessings on you and your family.  Do yourself
a favor and go out for pizza tonight. =)

-ryan

Quote:

> Your best bet is to get the file name from the user first, store it in a
> variable, and pass that to the TransferText method.  If you want to use the
> common Windows File Save dialog to get the name and path from the user, see
> this link:

>     www.mvps.org/access/api0001.htm

> Note:  it's possible I have got the wrong filename in the above link, as I
> keyed it from memory, but if you start with www.mvps.org/access, you should
> be able to find it.

> --

> Dirk Goldgar
> (to reply via email, remove NOSPAM from address)


> >So far so good man.  Thanks for the advice.  Quick question though:  Is
> there a
> >way to NOT supply the file name so that the user can specify the file name
> and
> >where on the network he wishes to save it?

> >-ryan


> >> You can use the TransferText method (see the online help) to export
> >> to/import from a text file.  The only hitch I know about is that
> >> TransferText tends to round floating-point fields to two decimals,
> possibly
> >> losing significant data.  If this is a problem, you can first create a
> query
> >> that formats the problem fields into text expressions with the desired
> >> degree of precision, and then export that query.  On import, you should
> be
> >> able to import directly to your table.

> >> You can also transfer data to/from other formats, such as another Access
> >> .mdb file, an Excel spreadsheet, and so on.  It's in the online help.
> >> --

> >> Dirk Goldgar
> >> (to reply via email, remove NOSPAM from address)


> >> >Alright, I totally overlooked something in an application I'm writing.
> >> >What I need to know is how to write all the data in a table out to a
> >> >file so that it can be loaded back into the table in the future.
> >> >However, I'm a somewhat pseudo-newfy with VB/VBA (I'm mostly a
> >> >Java/PHP/C based languages kinda guy)...  anybody got any ideas on what
> >> >I should look into (btw:  I currently have no books and no money... so
> >> >online references would be great, or if you just wanna tell me the
> >> >answer. =)

> >> >-ryan



Sat, 23 Aug 2003 06:25:46 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. diverting dBase IV data writes to dbf files to SQL7 tables

2. performance of writing data writing into database tables

3. File I/O - writing/inserting data to existing file

4. Open a text file, search for place holder, then write data to file

5. Write ADO Field containing binary data (files) to the file system

6. Writing table data to an existing spreadsheet

7. Help Writing a complex form's data to a table

8. Using MS Data Shaping with OLE DB - data from more than one table in mpp file

9. How To write huge amount of data in to a table

10. Writing Data from One Table to Another with VB

11. performance of writing data into access table

12. read write error when attempting to write to dbo_tblCounts (Access linked table)

 

 
Powered by phpBB® Forum Software