我正在尝试运行此代码:
<%
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')"
%>
不幸的是,即使在服务器管理中运行此代码,我也会看到以下错误消息:
链接服务器“(null)”的 OLE DB 提供程序“MSDASQL”返回消息“[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified”。消息 7303,级别 16,状态 1,行 1 无法初始化链接服务器“(null)”的 OLE DB 提供程序“MSDASQL”的数据源对象。
关于如何解决它的任何想法?我已经为连接设置了 DSN