Import Excel Data Into SQL Server – ERROR: “ODBC –Connection to {SQL Server} servernamesqlserverna

I am trying to do something fairly simple.. allow my user to import thier data from Excel into SQL Server, where it can be used by the application.

To do this, I’m using the fairly simple code that is common everywhere I look:

strFilePath = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” + fdlgFileOpen.FileName + “;Extended Properties=Excel 8.0”
connExcel = New OleDbConnection(strFilePath)
Dim ExcelCommand As New OleDbCommand(“INSERT INTO [ODBC;Driver={SQL Server};Server=servername _
    sqlservername;Database=MyriadSQL;Trusted_Connection=Yes;].[tblCostCodes] (CC_L1, CC_L2, CC_L3, CC_L4, CC_L5, _     

    CC_Description) SELECT * FROM [CostCodes$];”, connExcel)
Catch ex As Exception
End Try

Now, on my development computer this code works perfectly.  The data imports, and I can go on my merry way.

On the TEST computer, this code throws the error: “ODBC — Connection to {SQL Server} servernamesqlservername  failed.”  This seems very odd to me, because I’m using exactly the same SQL Server and database to interact with the application,
and all the other screens in the application work perfectly.  The test computer CAN connect to this SQL Server, but it keeps throwing this error whenever I try import data from Excel.

I’ve tried everything I can think of – using the server’s IP address instead of the server name, sending the SQL Server administrator data along with the request, taking out the Trusted_Connection=Yes… nothing works.  What is going on here? 
How can this code work fine on my computer, and hiccup on another?

Thank you for your help,


Here’s a resource that may be helpful:Insert data  into sql  Server table from Excel   /