Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel---> dbf (dBase4) - how to get decimals in numbers?
Message
De
05/12/2005 08:15:01
 
 
À
05/12/2005 05:14:49
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01074817
Message ID:
01074884
Vues:
23
"Might help" is the understatement of the year, Cetin!!!!
It's a MIRACLE < s >

Seriously, I spent the whole weekend getting seriously into VBA/Excel for the first time and was tearing my hair out just trying to navigate the Help, let alone the other machanics of using VBA in Excel.
It certainly was a valuable exercise, but being so close yet still so far away simply continued the frustration.

These few lines of code will be getting lots of use, Cetin.
Thanks

>>I have a spreadsheet that I am "exporting" as a dbf file using "Save As" in Excel and selecting "dBase4" as the output file type.
>>
>>Aside from the fact that 1 or some columns seem to cause an error when opening in VFP (a subset of the columns, when saved as, opens OK), none of the numeric fields with decimals is showing any decimals, ending up as "N(5,0)".
>>
>>I am using the following to set the column format:
oSheet2.Cells(1, xx).NumberFormat = "##,##0.00_);[Red](##,##0.00)"
and I have even gone to the trouble of filling the first data row with the value 0.01 before doing the "Save As".
>>
>>Anyone know how I can get decimals reflected properly?
>>
>>Thanks
>
>Jim,
>This is not directly related to question but might help.
>
>lcXLS = getfile('XLS')
>lcConn = "Driver={Microsoft Excel Driver (*.xls)};"+;
>  "DriverId=790;Dbq="+m.lcXLS+;
>  ";DefaultDir="+JustPath(m.lcXLS)+";"
>lnHandle = SQLStringConnect(lcConn)
>SQLTables(lnHandle,"", "SheetNames")
>Scan
>	lcTableName = Trim(SheetNames.Table_Name)
>	lcOutput = Chrtran(m.lcTableName,' $','_')
>	SQLExec(m.lnHandle,'select * from ['+m.lcTableName+']',m.lcOutput )
>endscan
>SQLDisconnect(m.lnHandle)
>
Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform