0
我非常非常沉迷于此,非常感谢帮助。 我想要做什么?链接服务器“(null)”的OLE DB提供程序“MSDASQL”报告了一个错误
有一个ASP页(经典的ASP)使用CSV上传的是提供了以下错误:
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
我已经创建了两个链接的服务器:
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'
和
EXEC sp_addlinkedserver
@server = 'Server1',
@srvproduct = '',
@provider = 'MSDASQL',
@datasrc = '
'
当我在下面的查询代替MSDASQL通过txtsrv我得到这个错误:
The OLE DB provider "txtsrv" has not been registered.
这是插入完成代码:年底
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
:updCmd.Execute我得到上述错误。
我会做什么错?
在此先感谢!
PS:服务器是Win2003的R2 x86的