Solved

Exporting table to DBF and number of decimal spaces

Posted on 2003-10-31
10
443 Views
Last Modified: 2008-01-09
I have this code (below) that works fine with one exception. In my table I have a field set as Double with 9 decimal spaces. When I export the table to DBF it only gives the field 5 decimal places. Anyway to force it to give 9?

Thanks!


Private Sub ExportWebSponsorsGeocodecmd_Click()
On Error GoTo Err_ExportWebSponsorsGeocodecmd_Click
DoCmd.SetWarnings True
DoCmd.TransferDatabase acExport, "dBase III", "\\Clustertor1\storage\SponsorDatabase\GeoCode\", acTable, _
   "tbl_Combined_All_Sponsors", Format(Now(), "mmddyy") & "_GeoCode.dbf"
   MsgBox "File Exported for Geocoding", vbOKOnly, "Finished"
End Sub
0
Comment
Question by:cmcgregor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
10 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 9658253
you could try to use a format statement in your query like:
format(field,"0.00000000") as NineDecimals

Nic;o)
0
 

Author Comment

by:cmcgregor
ID: 9659612
I dont think there is anywhere to put something like that in the DoCmd.TransferDatabase command.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 9661323
Just create a query with the fields including the FORMAT statement and use instead of:
acTable, _
   "tbl_Combined_All_Sponsors"
acQuery, _
   "qry_Combined_All_Sponsors"

Nic;o)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:cmcgregor
ID: 9679500
I thought that would work too but it doesnt. When I create the query and look at it in select mode it has the 9 decimal spaces. When I export it to dbf it changes it to a character field.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 9680691
Does your dbf table support the number of decimals ?

Nic;o)
0
 

Author Comment

by:cmcgregor
ID: 9680800
The access table.? I have the number format set a double with 9 decimal but it always exports 5 decimals.
I export as dbaseIII, dbase V and dbase Iv and none of them work.
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 50 total points
ID: 9688054
No, the dbf table that needs to receive the data.
When that has a max of five, transferring 9 won't work.
Getting a text field with nine decimals could be used to export the file to a .csv file and import that into the .dbf.

Nic;o)
0
 

Author Comment

by:cmcgregor
ID: 9688073
can i do that all through access though? I dont think I can. I am trying to automate the process, so would not want them to have to export to txt then open foxpro import to dbf etc...
I may be out of luck on this one.
0
 
LVL 39

Expert Comment

by:stevbe
ID: 10012519
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: nico5038 {http:#9688054}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

stevbe
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question