General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Network:
Windows 2003 Server
Good idea! I implemented my solution thusly...
All fields returned with afields... I change the name of the field to _fname001,_fname002,_fname003,... where fname is the name returned. the _ at the start solved the invalid fieldname and the 001... makes sure the field name is unique...
Then I create a new table from the new afields and populate it via scanning through the table and scattering the fields to an array and then inserting the values into the new table.
It works with fields no field name spreadsheets i.e. with no first row, with field names starting with an invalid character, and with spreadsheets with valid field names as well.
Thank you Ian,
Mike
>Hi Mike.
>
>I don't think that you will be able to field the field name programatically since, because the field name is invalid, you won't be abel to reference it.
>
>I'd suggest that you use AFields to read the structure, change the names in the array that are invalid, use that to create a cursor and then append from the cursor with the invalid field names. If the Append From fails because it sees the invalid names, then I'd try copying the data into an array and appending from that to see if that gets around it.
>
>Ian Simcock.
>
>
>
>>If I try to brow the cursor, I get "The data source for this object must be a variable reference". error I am assuming this error occurs because the one field has a name of "800" i.e. in the code above the lcFldName is "800" and lcNewFldName would be "_800" which would be a valid field name.
>>
>>Does the above help?
>>Thanks again,
>>Mike
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only