views:

26

answers:

0

Hi all,

I'm very very stuck here, help is greatly appreciated. What am I trying to do?

There is an ASP-page (classic ASP) with a CSV upload that gives the following error:

Microsoft OLE DB Provider for SQL Server error '80040e14'

The OLE DB provider "MSDASQL" for linked server "(null)" reported an error. The provider did not give any information about the error.

/ùùù.stocklist.be/importCSVProcess.asp, line 86 

I have created two linked servers:

   EXEC master.dbo.sp_addlinkedserver
          @server = N'txtsrv'
        , @srvproduct=N'Jet 4.0'
        , @provider=N'Microsoft Text Driver (*.txt; *.csv)'
        , @datasrc=N'D:\WEBSITES\ùùù.stocklist.be\csv\upload'
        , @provstr=N'Text'

and

            EXEC sp_addlinkedserver 
   @server = 'Server1', 
   @srvproduct = '',
   @provider = 'MSDASQL', 
   @datasrc = '

'

When I replace MSDASQL by txtsrv in the following query I get this error:

The OLE DB provider "txtsrv" has not been registered.

This is the code where the insert is done:

If upl.Form("rdbType") = "lot" Then
            updFileNameSQL ="insert into cos_lot(lot_vin) " & _
                    "SELECT vin  " & _
                    "FROM OPENROWSET  " & _
                    "('MSDASQL',  " & _
                    "'Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=" & sServerPath & ";',  " & _
                    "'SELECT vin from " & UplFileName & "') " & _
                    "where not vin IS NULL AND  vin collate SQL_Latin1_General_CP1_CI_AS not in (select  lot_vin from cos_lot) " 


    Set updCmd = Server.CreateObject("ADODB.Command")
        updCmd.ActiveConnection = MM_COS_STRING
        updCmd.CommandText = updFileNameSQL 
        updCmd.Execute
ElseIf upl.Form("rdbType") = "premie" Then
    updFileNameSQL ="INSERT INTO [ùùùSTOCKLIST].[dbo].[COS_ANNEX] " & _
                       "([annex_type] " & _
                       ",[annex_chassisnr] " & _
                       ",[annex_datum] " & _
                       ",[annex_userid] " & _
                       ",[annex_stockid] " & _
                       ",[annex_commentNL] " & _
                       ",[annex_commentFR] " & _
                       ",[annex_premie] " & _
                       ",[annex_premie_type] " & _
                       ",[annex_consignatie] " & _
                       ",[annex_eindeconsignatie] " & _
                       ",[annex_online] " & _
                       ",[annex_onlinefrom] " & _
                       ",[annex_onlineto] " & _
                       ",[annex_libelle]) " & _
                        "SELECT 2 " & _
                        ",[VIN] " & _
                        ",Getdate() " & _
                        ", " & Session("user_id") & " " & _
                        ",[STOCK] " & _
                        ",'' " & _
                        ",'' " & _
                        ",Replace([PREMIE],',','.') " & _
                        ",'E' " & _
                        ",Null " & _
                        ",Null " & _
                        ",1 " & _
                        ",cast([ONLINEFROM] as smalldatetime) " & _
                        ",cast([ONLINETO] as smalldatetime) " & _
                        ",[TYPE]  " & _
                        "FROM OPENROWSET  " & _
                        "('MSDASQL',  " & _
                        "'Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=" & sServerPath & ";',  " & _
                        "'SELECT vin,stock,type,premie,onlinefrom,onlineto from " & UplFileName & "') " & _
                        "WHERE NOT VIN IS NULL "

    Set updCmd = Server.CreateObject("ADODB.Command")
        updCmd.ActiveConnection = MM_COS_STRING
        updCmd.CommandText = updFileNameSQL 
        updCmd.Execute
End If

at the end: updCmd.Execute I get the above error.

What could I be doing wrong?

Thanks in advance!

PS: server is Win2003 R2 x86