简体   繁体   中英

OLE DB provider 'MSDASQL' reported an error

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

It might be a problem between x32 and x64 drivers, which would be throwing the "driver not found" error.

Try this: Data source name not found and no default driver specified

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM