2

I'm trying to run this code:

<%
Dim rsSelectOrder
Dim rsSelectOrder_numRows

Set rsSelectOrder = Server.CreateObject("ADODB.Recordset")
rsSelectOrder.ActiveConnection = MM_conn_to_mhwebdb_STRING
rsSelectOrder.Source = "SELECT * from " & ActinicPersons &" p, " &ActinicOrders&" o WHERE p.    [Contact ID] = o.[Invoice Contact ID] AND o.[Order Number] NOT IN ( SELECT OrderNumber from    dbo.tbl_OrdersEntered )"
rsSelectOrder.CursorType = 0
rsSelectOrder.CursorLocation = 2
rsSelectOrder.LockType = 1
rsSelectOrder.Open()

rsSelectOrder_numRows = 0
%>

Using the following connection:

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO" 
' DesigntimeType="ADO"
' HTTP="true"
' Catalog=""
' Schema=""

Dim ActinicPersons, ActinicOrders, ActinicOrderLines, ActinicPayments
ActinicPersons = "OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};          DefaultDir=C:\inetpub\ActinicOrderFiles\;','select *  FROM persons.csv')"
ActinicOrders = "OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};      DefaultDir=C:\inetpub\ActinicOrderFiles\;','select *  FROM orders.csv')"
ActinicOrderLines = "OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};      DefaultDir=C:\inetpub\ActinicOrderFiles\;','select *  FROM orderlines.csv')"
ActinicPayments = "OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};      DefaultDir=C:\inetpub\ActinicOrderFiles\;','select *  FROM payments.csv')"
%>

Unfortunately even running this code in server management I see the following error message:

OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

Any ideas on how to fix it? I have setup DSN for the connection

4

1 に答える 1

0

x32 ドライバーと x64 ドライバーの間の問題である可能性があり、「ドライバーが見つかりません」というエラーがスローされます。

これを試してください:データソース名が見つからず、デフォルトのドライバーが指定されていません

于 2013-02-04T13:54:39.283 に答える