I am having a problem with DTS importing NULL values from an Excel spreadsheet when there are numbers and text in the same column. Other than that, the import works fine. I am using VBScript in an ASP web page to create and execute a DTS package to import an Excel file.
I have read Allan Mitchell's article about using IMEX=1 (http://www.sqldts.com/default.aspx?254). I added IMEX=1 and modified the registry setting, but when I do that NO data at all is imported.
Any ideas? My code is very long, so I'll only post it if you'd really like to see it.
Originally posted by rnealejr
It has been a while since I used the TypeGuessRows - but I believe setting it to 0 will not work - you have to explicitly supply a value (something big enough to sample your data).
Programmatically - Do you mean from within sql server or any executable ?
I read somewhere to set it to 0 and use IMEX=1. I just tried setting it to 16 and 8, but neither of those worked either.
Actually, when I said programatically I meant VBScript, but I guess that's for the VBScript forum!
expression Required. An expression that returns a Chart or Worksheet object (Syntax 1) or a Workbook object (Syntax 2).
Filename Optional Variant. A string that indicates the name of the file to be saved. You can include a full path; if you donít, Microsoft Excel saves the file in the current folder.
FileFormat Optional Variant. The file format to use when you save the file. For a list of valid choices, see the FileFormat property. For an existing file, the default format is the last file format specified; for a new file, the default is the format of the version of Excel being used.
Password Optional Variant. A case-sensitive string (no more than 15 characters) that indicates the protection password to be given to the file.
WriteResPassword Optional Variant. A string that indicates the write-reservation password for this file. If a file is saved with the password and the password isnít supplied when the file is opened, the file is opened as read-only.
ReadOnlyRecommended Optional Variant. True to display a message when the file is opened, recommending that the file be opened as read-only.
CreateBackup Optional Variant. True to create a backup file.
AccessMode Optional Variant. The workbook access mode. Can be one of the following XlSaveAsAccessMode constants: xlShared (shared list), xlExclusive (exclusive mode), or xlNoChange (donít change the access mode). If this argument is omitted, the access mode isnít changed. This argument is ignored if you save a shared list without changing the file name. To change the access mode, use the ExclusiveAccess method.
ConflictResolution Optional Variant. Specifies the way change conflicts are resolved if the workbook is a shared list. Can be one of the following XlSaveConflictResolution constants: xlUserResolution (display the conflict-resolution dialog box), xlLocalSessionChanges (automatically accept the local userís changes), or xlOtherSessionChanges (accept other changes instead of the local userís changes). If this argument is omitted, the conflict-resolution dialog box is displayed.
AddToMru Optional Variant. True to add this workbook to the list of recently used files. The default value is False.
TextCodePage Optional Variant. Not used in U.S. English Microsoft Excel.
TextVisualLayout Optional Variant. Not used in U.S. English Microsoft Excel.
Originally posted by rnealejr
Yes, that looks good. Let me know if there are any problems.
Okay, I may have found the issue, but I'm not sure. I saved the current workbook file format value to a variable and printed it to the screen. The value was -4143. Is the fileformat value supposed to be a number or the values from the help file (i.e., xlCSV)?