If you have the source code to this program, can you change the processing that builds up lcNvlFieldList to check for bad characters?
On 19 April 2018 11:42:55 GMT-04:00, "Paul H. Tarver" paul@tpcqpc.com wrote:
I could, but that would require expanding the field name definitions out in advance of calling the routine which would be very difficult because at the time the command is issued, the program may or may not know all of the fields in the import file.
This code comes from the AppendXLSX.prg and there are often times when importing an Excel file, the main program won't know the full context of the Excel file to imported.
Paul
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Frank Cazabon Sent: Thursday, April 19, 2018 8:52 AM To: profoxtech@leafe.com Subject: Re: INSERT INTO...SELECT Issue
Can you rename the field in your SELECT like this:
SELECT BadFieldName AS GoodFieldName
?
Frank.
Frank Cazabon
On 19/04/2018 09:38 AM, Paul H. Tarver wrote:
I posted a longer version of this situation previously, but it may
have been
mis-titled or included too much detail because I've gotten no
responses.
Here's the low down and dirty version:
When you use INSERT INTO.SELECT from a remote data source that
includes
fieldnames that begin with numbers in the development environment,
VFP9
automatically changes the leading digit in the field name to an
underscore
('_'). However, when executing the same command as a compiled
executable
this automatic substitution does not occur and VFP will allow
fieldnames
with a leading digit to be returned in the resultant cursor. This
causes
major problems later if you use the remote data cursor to create a
new
cursor because Foxpro won't allow field names with a number in the
first
position. ALTER TABLE cannot be used on the remote data cursor and
even if
you make the cursor READWRITE, the length of the fieldnames can often
exceed
10 characters.
My question is this: Has anyone here run into this issue and if so,
Is there
any another way or procedure around this situation that would allow
me to
manually fix the fieldnames which start with a number assuming I have
no way
to change the source data.
Thanks in advance.
Paul
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]