我试图运行此代码:
<%
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
%>
使用以下连接:
<%
' 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')"
%>
不幸的是,即使在服务器管理中运行此代码,我也会看到以下错误消息:
OLE DB提供程序&#34; MSDASQL&#34;对于链接服务器&#34;(null)&#34;返回消息&#34; [Microsoft] [ODBC驱动程序管理器]未找到数据源名称且未指定默认驱动程序&#34;。 Msg 7303,Level 16,State 1,Line 1 无法初始化OLE DB提供程序的数据源对象&#34; MSDASQL&#34;对于链接服务器&#34;(null)&#34;。
有关如何修复它的任何想法?我已为连接设置了DSN
答案 0 :(得分:0)
这可能是x32和x64驱动程序之间的问题,这会导致“找不到驱动程序”错误。
试试这个:Data source name not found and no default driver specified