Help needed to convert excel file into .DBF file

Help needed to convert excel file into .DBF file

Postby RAMESHBABU » Sat Dec 06, 2008 2:54 am

Hi

Can anybody help me on the subject.

Thanks

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby Armando » Sat Dec 06, 2008 3:31 am

RAMESHBABU:

Your better alternative is Ole

Please take a look to Jeff Barnes Tips & Tricks

http://www.fivewin.info/html/tips___tri ... .php?id=46

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3211
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Help needed to convert excel file into .DBF file

Postby Enrico Maria Giordano » Sat Dec 06, 2008 11:39 am

Code: Select all  Expand view
#define xlDBF3 8


FUNCTION MAIN()

    LOCAL oExcel := CREATEOBJECT( "Excel.Application" )

    LOCAL oWorkBook, oSheet

    oWorkbook = oExcel:WorkBooks:Open( "E:\XHARBOUR\MYTEST.XLS" )

    oSheet = oExcel:ActiveSheet

    oSheet:SaveAs( "E:\XHARBOUR\MYTEST.DBF", xlDBF3 )

    oWorkBook:Close( .F. )

    oExcel:Quit()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby RAMESHBABU » Sat Dec 06, 2008 3:43 pm

Hello Mr.Enrico,

Thanks you. As usually, you have helped me this time too.

Regards,

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: Help needed to convert excel file into .DBF file

Postby RAMESHBABU » Wed Jan 07, 2009 6:48 am

Hello Mr.Enrico and Friends

When I tried to save the Excel file as .DBF file, I am getting the data column as a character type field in the
target .DBF file.

Can you please give any solution to this problem.

Thanks

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: Help needed to convert excel file into .DBF file

Postby anserkk » Wed Jan 07, 2009 7:41 am

RAMESHBABU wrote:When I tried to save the Excel file as .DBF file, I am getting the data column as a character type field in the
target .DBF file.


Dear Ramesh,

Please check whether the Data in the excel sheet is Character or not. I mean a numeric figure is entered as character in any of the rows of a particular column.

For Eg: '1234' instead of 1234 (Press F2 Key in that particular cell)

I believe that if the data in the Excel column is text type then Target .DBF is created with Character Field Type

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Help needed to convert excel file into .DBF file

Postby Detlef Hoefner » Wed Jan 07, 2009 7:48 am

Ramesh,

it's no good idea to save an Excel file as dbf file.
I tried this many times without success.

Excel is doing a lot of nonsense like

    column types are changed from numeric to character
    sometimes columns are completely ignored
    the length of fields are mostly wrong
    the maximum of rows to be exported is limited

It's the better way to read the cell values from Excel and write them into a dbf.

Just my 2 cents,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Re: Help needed to convert excel file into .DBF file

Postby anserkk » Wed Jan 07, 2009 8:13 am

column types are changed from numeric to character
sometimes columns are completely ignored
the length of fields are mostly wrong
the maximum of rows to be exported is limited

It's the better way to read the cell values from Excel and write them into a dbf.


I agree with this

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Help needed to convert excel file into .DBF file

Postby RAMESHBABU » Wed Jan 07, 2009 8:46 am

Hi Mr.Detlef and Mr.Anser

Thanks for your attention.

Even I too faced the similar problems you have mentioned.
I too agree with your conclusion.

Thanks

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: Help needed to convert excel file into .DBF file

Postby hua » Wed Jan 07, 2009 9:45 am

Detlef Hoefner wrote:it's no good idea to save an Excel file as dbf file.


Not to mention it's a feature that will be removed from future version of Excel.
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Help needed to convert excel file into .DBF file

Postby Silvio » Wed Jan 07, 2009 12:58 pm

there is an xbrowse sample
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests

cron