我无法连接到另一台服务器上的数据库。我已经设置了在测试中完美运行的 DSN。但是,当使用以下代码运行 asp 脚本时:
<%
Dim rsGetInvoiceContact
Dim rsGetInvoiceContact_numRows
Set rsGetInvoiceContact = Server.CreateObject("ADODB.Recordset")
rsGetInvoiceContact.ActiveConnection = MM_conn_to_EFACs_STRING_ap
rsGetInvoiceContact.Source = "SELECT * from "& ActinicPersons &" p WHERE p.[Contact ID] = " + Replace(rsGetInvoiceContact__vInvoiceID, "'", "''") + ""
rsGetInvoiceContact.CursorType = 0
rsGetInvoiceContact.CursorLocation = 2
rsGetInvoiceContact.LockType = 1
rsGetInvoiceContact.Open()
rsGetInvoiceContact_numRows = 0
%>
使用以下连接字符串:
Dim MM_conn_to_EFACs_STRING_ap
MM_conn_to_EFACs_STRING_ap = "dsn=DSNefacsdb2;uid=IUSR_RFS01;pwd=Splendid01;"
运行脚本后显示错误:
[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error.
/Sales/order_entry.asp, line 55
当对本地数据库运行脚本时,它可以按我的意愿工作,我已经为用户 IUSR_RFS01 调整了其他数据库的所有权限,但仍然没有乐趣!:(