Solved

Using DTS to import data from an excel spreadsheet SQL version 2003 version 8.0

Posted on 2008-10-02
3
628 Views
Last Modified: 2012-06-21
I've been using this spreadsheet for quite sometime, but with a different company.  I can't seem to get it to work now.  Please see attached error message and Excel file
DTS-Error-Message.doc
New-Prop-Template.xls
0
Comment
Question by:rhonlw83
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Accepted Solution

by:
Brendt Hess earned 500 total points
ID: 22638245
The Excel DTS import does not like certain fields where they contain all numbers, but the field is formatted as text.  I have found it easier to prepend on a single quote on any field containing numeric text to ensure that the DTS package succeeds.

Here is a snippet of Excel macro code that will ensure that the values in the cells will be treated as strings by the DTS import routines.  Try running it against that column, then run the import.  I believe your import will succeed.
Sub Textify()
'
' Select the last cell in the column that needs to be textified
' So, if data exists in column C, go to the last cell in that 
'   column with data in it, then run the macro. 
    Do
        If ActiveCell.Row = 1 Then Exit Do
        If Left(ActiveCell.FormulaR1C1, 1) <> "'" Then
            ActiveCell.FormulaR1C1 = "'" & ActiveCell.FormulaR1C1
        End If
        ActiveCell.Offset(-1, 0).Activate
    Loop
End Sub

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question