?
Solved

Exporting table to DBF and number of decimal spaces

Posted on 2003-10-31
10
Medium Priority
?
448 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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 200 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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

762 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