Hi all-
Got a tricky one for ya. I have an Excel datasource that I need to import
into an Access DB. I've been to www.cfcomet.com (excellent site, by the
way...definitely visit for any issues with accessing MS Office Objects
through CF) which gave me a start, but I've run into a problem I can't find
addressed anywhere.
When creating an ODBC datasource for Excel, you define how many rows to scan
to allow CF to determine what the datatype of each field is. If you have
column headings in your spreadsheet, then they are automatically used as
field names when imported. I have set the number of rows to scan to 1,
hoping to force the ODBC driver to use the column headings as the
determining factor for data type determinination, and that didn't work. I
figured maybe it was skipping the first row and reading the second, so I
added "Do not alter this text" in every field in row two, again hoping to
force the datatypes to strings.
Didn't work. :( I have one particular field which, in some cases:
a) is blank,
b) has a number in it, or
c) has multiple numbers, separated by spaces (ie. 3 5 2)
For whatever reason, CF is importing this field as a number, converting the
3 to 3.0, and dropping the rest of the field. This has me stymied, because
if I can't import this spreadsheet properly, then the project is going to
die very quickly. Any ideas on how to force the datatype of the fields
being imported to strings? Is there some SQL snytax that can define in the
SELECT statement something like SELECT {fieldname} AS STRING FROM "Sheet1$"?
Any help would be appreciated.
Thanks...
-Kev
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists