dbTalk Databases Forums  

Import from Excel .xls problem

comp.databases.paradox comp.databases.paradox


Discuss Import from Excel .xls problem in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Toby Sleigh
 
Posts: n/a

Default Import from Excel .xls problem - 03-03-2009 , 06:16 AM






Hi
I'm trying to import a very simple ( 12 columns, no fancy formatting,
originally generated by export from Paradox ) .xls into a Paradox table.
However I constantly get an error "Unable to get table field descriptions"

I've found various references to this problem , for example this
http://tinyurl.com/cs8vkv says it should work if all refs to aliases are
removed.
I've reduced what I am trying to the bare minimum, based on that thread, but
still get the error.


var
dt DataTransfer
endvar

dt.setSource("C:\\SSin\\Feb09.xls")
dt.setDest ("C:\\SSin\\Feb09.db")
dt.setDestFieldNamesFromFirst(True)
dt.setProblems ( True )
dt.getSourceRange()
dt.transferData ( )

nor does
importSpreadSheet("C:\\SSin\\Feb09.xls","C:\\SSin\ \Feb09.db", "A1", "L300",
false)
work.

I would be really grateful for any ideas.

Excel 97 workbook,
Paradox 11 ( 11.0.0.300)
Win XP Prof sp3

thanks
Toby



Reply With Quote
  #2  
Old   
Liz McGuire
 
Posts: n/a

Default Re: Import from Excel .xls problem - 03-03-2009 , 11:47 AM







1. Are you sure Excel hasn't conveniently saved the file as something newer
that Excel 5.0 without telling?

2. Are you sure the column headers in Excel are valid Paradox field names?

NOTE: Check bug PX0576 in Bertil's website: http://hem.bredband.net/bertilisberg/
(under current bugs). Is your spreadsheet read-only? Anywho, there are
a lot of bugs listed there, so just search the page for "spreadsheet" and
read them until you find a solution (or that there isn't a solution).

I believe Vladimir has a free library for dealing with Excel files: http://vmsoft.org/

Liz


"Toby Sleigh" <toby.sleigh (AT) gmail (DOT) com> wrote:
Quote:
However I constantly get an error "Unable to get table field descriptions"


var
dt DataTransfer
endvar

dt.setSource("C:\\SSin\\Feb09.xls")
dt.setDest ("C:\\SSin\\Feb09.db")
dt.setDestFieldNamesFromFirst(True)
dt.setProblems ( True )
dt.getSourceRange()
dt.transferData ( )

nor does
importSpreadSheet("C:\\SSin\\Feb09.xls","C:\\SSin\ \Feb09.db", "A1", "L300",

false)
work.

I would be really grateful for any ideas.

Excel 97 workbook,
Paradox 11 ( 11.0.0.300)
Win XP Prof sp3




Reply With Quote
  #3  
Old   
modri dirkac
 
Posts: n/a

Default Re: Import from Excel .xls problem - 03-04-2009 , 01:38 AM



Does Vladimir's library work with Pdox7/32?
I can not get it to work.
But it works with Pdox 9.

Jure


"Liz McGuire" <liz (AT) paradoxcommunity (DOT) com> je napisal v sporočilo
news:49ad6d18$1 (AT) pnews (DOT) thedbcommunity.com ...
Quote:
1. Are you sure Excel hasn't conveniently saved the file as something
newer
that Excel 5.0 without telling?

2. Are you sure the column headers in Excel are valid Paradox field names?

NOTE: Check bug PX0576 in Bertil's website:
http://hem.bredband.net/bertilisberg/
(under current bugs). Is your spreadsheet read-only? Anywho, there are
a lot of bugs listed there, so just search the page for "spreadsheet" and
read them until you find a solution (or that there isn't a solution).

I believe Vladimir has a free library for dealing with Excel files:
http://vmsoft.org/

Liz


"Toby Sleigh" <toby.sleigh (AT) gmail (DOT) com> wrote:

However I constantly get an error "Unable to get table field descriptions"


var
dt DataTransfer
endvar

dt.setSource("C:\\SSin\\Feb09.xls")
dt.setDest ("C:\\SSin\\Feb09.db")
dt.setDestFieldNamesFromFirst(True)
dt.setProblems ( True )
dt.getSourceRange()
dt.transferData ( )

nor does
importSpreadSheet("C:\\SSin\\Feb09.xls","C:\\SSin\ \Feb09.db", "A1",
"L300",

false)
work.

I would be really grateful for any ideas.

Excel 97 workbook,
Paradox 11 ( 11.0.0.300)
Win XP Prof sp3






Reply With Quote
  #4  
Old   
Toby Sleigh
 
Posts: n/a

Default Re: Import from Excel .xls problem - 03-04-2009 , 02:15 AM




"Liz McGuire" <liz (AT) paradoxcommunity (DOT) com> wrote

Quote:
1. Are you sure Excel hasn't conveniently saved the file as something
newer
that Excel 5.0 without telling?

2. Are you sure the column headers in Excel are valid Paradox field names?

NOTE: Check bug PX0576 in Bertil's website:
http://hem.bredband.net/bertilisberg/
(under current bugs). Is your spreadsheet read-only? Anywho, there are
a lot of bugs listed there, so just search the page for "spreadsheet" and
read them until you find a solution (or that there isn't a solution).

I believe Vladimir has a free library for dealing with Excel files:
http://vmsoft.org/

Liz

Hi Liz

1. I've tried save as to various versions, no difference.
2. Checked, plus the spreadsheet originated from a Paradox table.
3. I've checked through Bertil's bug list. I've tried
protecting/unprotecting, sticking the xls in the pdoxwin.exe directory etc.

I can't believe that a simple import from Excel should prove to be
impossible. I'll have a look at Vladimir's stuff next. Thanks.

Toby




Reply With Quote
  #5  
Old   
Jim Giner
 
Posts: n/a

Default Re: Import from Excel .xls problem - 03-04-2009 , 06:48 AM



Hate to repeat something, but the message you get indicates something wrong
when pdx attempts to identify how to format the fields. Now that could be
not recognizing the data, or simply not being able to name the field (altho
I thought it would default to something generic). YOu never responded to
Liz's question on field names. Could you list them here?
Quote:
2. Are you sure the column headers in Excel are valid Paradox field
names?

Once we see valid names are being used, the next ? would be - is the data
consistent across the board? I do believe that pdox may operate a lot like
excel and establish the "type" of each field by the contents of the first
row's cells. You may have to ensure that the first row in your .xls
contains representative data in each col so pdox has something to work with
from the start.




Reply With Quote
  #6  
Old   
Toby Sleigh
 
Posts: n/a

Default Re: Import from Excel .xls problem - 03-04-2009 , 07:53 AM




"Jim Giner" <jim.giner (AT) suny (DOT) edu> wrote

Quote:
Hate to repeat something, but the message you get indicates something
wrong when pdx attempts to identify how to format the fields. Now that
could be not recognizing the data, or simply not being able to name the
field (altho I thought it would default to something generic). YOu never
responded to Liz's question on field names.
I did too, the field names came from the original Paradox table.

Could you list them here?

ok -

Job Number
Part Num
Model
QTY
Price
Availability
Date Ord
Ord by
Description
Our Ref
Bonded
ESCODid


Quote:
2. Are you sure the column headers in Excel are valid Paradox field
names?
Just in case I have tried renaming the column names to a,b,,,,,m , no
difference.
Then I deleted every column apart from the first column., no difference.

Quote:
Once we see valid names are being used, the next ? would be - is the data
consistent across the board? I do believe that pdox may operate a lot
like excel and establish the "type" of each field by the contents of the
first row's cells. You may have to ensure that the first row in your .xls
contains representative data in each col so pdox has something to work
with from the start.

The first row contains representative data. I've seen the problem you refer
to before, when I've been importing manually, ie select then save as, when
the column contained serial numbers and the first row or two was by chance a
number, eg 1234567 then the next row was AB34567. The resultant table had
the column as a number field, rather than alpha. ( Or something like that ,
it was a while ago.)


All I want to do is export a small table to Excel, email the new spreadsheet
to a supplier, he fills in a couple of fields and sends the spreadsheet back
to us.




Reply With Quote
  #7  
Old   
Tony McGuire
 
Posts: n/a

Default Re: Import from Excel .xls problem - 03-04-2009 , 08:07 AM



Toby Sleigh wrote:
Quote:
ok -

Job Number
Part Num
Model
QTY
Price
Availability
Date Ord
Ord by
Description
Our Ref
Bonded
ESCODid


Is 'Description" a multi-line field that could be interpretted differently
line-to-line from Excel? That's one of the common issues when going from
Excel to Paradox.

Are you importing to a NEW table each time, or an existing table? In other
words, is Paradox creating the table as it is bringing in the data? If so,
could you try bringing in the data to a table where you already have the
table/field definitions set as the data should be?


---------------
Tony McGuire
http://www.lostlore.com


Reply With Quote
  #8  
Old   
Jim Giner
 
Posts: n/a

Default Re: Import from Excel .xls problem - 03-04-2009 , 08:49 AM



As soon as I tried it out myself I remembered the problem.

Because EXCEL is processing the command first (on an export, I guess pdox
processes the command first), you CANNOT use an alias in the paths of the
file references in the command line - you must be explicit. Works great
after you change those.

Instead of
importspreadsheet(":myalias:myfile.xls",":myalias: myfile.db",........) you
must say
importspreadsheet("c:\\folder1\\subfolder1\\myfile .xls","c:\\folder1\\subfolder1\\myfile.db",.....)

One of those un-documented quirks.
"Toby Sleigh" <toby.sleigh (AT) gmail (DOT) com> wrote

Quote:
"Jim Giner" <jim.giner (AT) suny (DOT) edu> wrote in message
news:49ae78aa$1 (AT) pnews (DOT) thedbcommunity.com...
Hate to repeat something, but the message you get indicates something
wrong when pdx attempts to identify how to format the fields. Now that
could be not recognizing the data, or simply not being able to name the
field (altho I thought it would default to something generic). YOu never
responded to Liz's question on field names.

I did too, the field names came from the original Paradox table.

Could you list them here?

ok -

Job Number
Part Num
Model
QTY
Price
Availability
Date Ord
Ord by
Description
Our Ref
Bonded
ESCODid



2. Are you sure the column headers in Excel are valid Paradox field
names?

Just in case I have tried renaming the column names to a,b,,,,,m , no
difference.
Then I deleted every column apart from the first column., no difference.

Once we see valid names are being used, the next ? would be - is the data
consistent across the board? I do believe that pdox may operate a lot
like excel and establish the "type" of each field by the contents of the
first row's cells. You may have to ensure that the first row in your
.xls contains representative data in each col so pdox has something to
work with from the start.


The first row contains representative data. I've seen the problem you
refer to before, when I've been importing manually, ie select then save
as, when the column contained serial numbers and the first row or two was
by chance a number, eg 1234567 then the next row was AB34567. The
resultant table had the column as a number field, rather than alpha. ( Or
something like that , it was a while ago.)


All I want to do is export a small table to Excel, email the new
spreadsheet to a supplier, he fills in a couple of fields and sends the
spreadsheet back to us.




Reply With Quote
  #9  
Old   
Jim Moseley
 
Posts: n/a

Default Re: Import from Excel .xls problem - 03-04-2009 , 08:49 AM




Tony,

Quote:
Are you importing to a NEW table each time, or an existing table?
I think Tony's on to something. Does this table already exist? If so, try
a new table like 'Feb09Input.db' or so & see if it still squawks.

dt.setDest ("C:\\SSin\\Feb09Input.db")

HTH,
Jim Moseley



Reply With Quote
  #10  
Old   
Toby Sleigh
 
Posts: n/a

Default Re: Import from Excel .xls problem - 03-04-2009 , 09:37 AM




"Jim Giner" <jim.giner (AT) suny (DOT) edu> wrote

Quote:
As soon as I tried it out myself I remembered the problem.

Because EXCEL is processing the command first (on an export, I guess pdox
processes the command first), you CANNOT use an alias in the paths of the
file references in the command line - you must be explicit. Works great
after you change those.

Instead of
importspreadsheet(":myalias:myfile.xls",":myalias: myfile.db",........) you
must say
importspreadsheet("c:\\folder1\\subfolder1\\myfile .xls","c:\\folder1\\subfolder1\\myfile.db",.....)

One of those un-documented quirks.
ummmm..
see my original post...............

var
dt DataTransfer
endvar

dt.setSource("C:\\SSin\\Feb09.xls")
dt.setDest ("C:\\SSin\\Feb09.db")
dt.setDestFieldNamesFromFirst(True)
dt.setProblems ( True )
dt.getSourceRange()
dt.transferData ( )

nor does
importSpreadSheet("C:\\SSin\\Feb09.xls","C:\\SSin\ \Feb09.db", "A1", "L300",
false)
work.

thanks anyway.



Quote:
"Toby Sleigh" <toby.sleigh (AT) gmail (DOT) com> wrote in message
news:VtadnX417ZtfGjPUnZ2dnUVZ8v-WnZ2d (AT) bt (DOT) com...

"Jim Giner" <jim.giner (AT) suny (DOT) edu> wrote in message
news:49ae78aa$1 (AT) pnews (DOT) thedbcommunity.com...
Hate to repeat something, but the message you get indicates something
wrong when pdx attempts to identify how to format the fields. Now that
could be not recognizing the data, or simply not being able to name the
field (altho I thought it would default to something generic). YOu
never responded to Liz's question on field names.

I did too, the field names came from the original Paradox table.

Could you list them here?

ok -

Job Number
Part Num
Model
QTY
Price
Availability
Date Ord
Ord by
Description
Our Ref
Bonded
ESCODid



2. Are you sure the column headers in Excel are valid Paradox field
names?

Just in case I have tried renaming the column names to a,b,,,,,m , no
difference.
Then I deleted every column apart from the first column., no difference.

Once we see valid names are being used, the next ? would be - is the
data consistent across the board? I do believe that pdox may operate a
lot like excel and establish the "type" of each field by the contents of
the first row's cells. You may have to ensure that the first row in
your .xls contains representative data in each col so pdox has something
to work with from the start.


The first row contains representative data. I've seen the problem you
refer to before, when I've been importing manually, ie select then save
as, when the column contained serial numbers and the first row or two was
by chance a number, eg 1234567 then the next row was AB34567. The
resultant table had the column as a number field, rather than alpha. ( Or
something like that , it was a while ago.)


All I want to do is export a small table to Excel, email the new
spreadsheet to a supplier, he fills in a couple of fields and sends the
spreadsheet back to us.






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.