Solved

Exporting table to DBF and number of decimal spaces

Posted on 2003-10-31
10
430 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
 

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
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 …

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now