Solved

Exporting table to DBF and number of decimal spaces

Posted on 2003-10-31
10
436 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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

773 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