L
lzm
Unregistered / Unconfirmed
GUEST, unregistred user!
各位﹕
本人想做一ASP頁面﹐ 來維護SQL2000中的數據表。(客戶在WEB里報價﹐存入我的后台)
在ASP 和 SQL 連接時﹐無法通過。請看﹕
//--------------------------------
在IE5里運行時的出錯信息
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'LZMBAK/IUSR_LZMBAK'.
/Project/ASP Page1.asp, line 31
//--------------------------------
global.asa 文件
Application("Connection1_ConnectionString") = "DSN=shoe;UID=Administrator;APP=Microsoft Development Environment;WSID=LZMBAK;DATABASE=cbshoe;Network=DBMSSOCN;Trusted_Connection=Yes"
Application("Connection1_ConnectionTimeout") = 15
Application("Connection1_CommandTimeout") = 30
Application("Connection1_CursorLocation") = 3
Application("Connection1_RuntimeUserName") = "Administrator"
Application("Connection1_RuntimePassword") = ""
'-- Project Data Environment
Set DE = Server.CreateObject("DERuntime.DERuntime")
Application("DE") = DE.Load(Server.MapPath("Global.ASA"), "_private/DataEnvironment/DataEnvironment.asa")
//---------------------------------------
ASP里的數據庫連接調用
var DBConn = Server.CreateObject('ADODB.Connection');
DBConn.ConnectionTimeout = Application('Connection1_ConnectionTimeout');
DBConn.CommandTimeout = Application('Connection1_CommandTimeout');
DBConn.CursorLocation = Application('Connection1_CursorLocation');
DBConn.Open(Application('Connection1_ConnectionString'), Application('Connection1_RuntimeUserName'), Application('Connection1_RuntimePassword'));
var cmdTmp = Server.CreateObject('ADODB.Command');
var rsTmp = Server.CreateObject('ADODB.Recordset');
cmdTmp.ActiveConnection = DBConn;
rsTmp.Source = cmdTmp;
cmdTmp.CommandType = 2;
cmdTmp.CommandTimeout = 10;
cmdTmp.Prepared = true;
cmdTmp.CommandText = '"BWZL"';
rsTmp.CacheSize = 10;
rsTmp.CursorType = 2;
rsTmp.CursorLocation = 2;
rsTmp.LockType = 3;
Recordset1.setRecordSource(rsTmp);
Recordset1.open();
if (thisPage.getState('pb_Recordset1') != null)
Recordset1.setBookmark(thisPage.getState('pb_Recordset1'));
}
//---------------------------------------------------
從IE里登入SQL里用戶出錯。 可我有指定運行時的用戶名稱。
有資料稱IE登入SQL用戶名會時IUSR_XXXXX
連接不成功﹐啥事也無法做。請各位指教﹗
本人想做一ASP頁面﹐ 來維護SQL2000中的數據表。(客戶在WEB里報價﹐存入我的后台)
在ASP 和 SQL 連接時﹐無法通過。請看﹕
//--------------------------------
在IE5里運行時的出錯信息
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'LZMBAK/IUSR_LZMBAK'.
/Project/ASP Page1.asp, line 31
//--------------------------------
global.asa 文件
Application("Connection1_ConnectionString") = "DSN=shoe;UID=Administrator;APP=Microsoft Development Environment;WSID=LZMBAK;DATABASE=cbshoe;Network=DBMSSOCN;Trusted_Connection=Yes"
Application("Connection1_ConnectionTimeout") = 15
Application("Connection1_CommandTimeout") = 30
Application("Connection1_CursorLocation") = 3
Application("Connection1_RuntimeUserName") = "Administrator"
Application("Connection1_RuntimePassword") = ""
'-- Project Data Environment
Set DE = Server.CreateObject("DERuntime.DERuntime")
Application("DE") = DE.Load(Server.MapPath("Global.ASA"), "_private/DataEnvironment/DataEnvironment.asa")
//---------------------------------------
ASP里的數據庫連接調用
var DBConn = Server.CreateObject('ADODB.Connection');
DBConn.ConnectionTimeout = Application('Connection1_ConnectionTimeout');
DBConn.CommandTimeout = Application('Connection1_CommandTimeout');
DBConn.CursorLocation = Application('Connection1_CursorLocation');
DBConn.Open(Application('Connection1_ConnectionString'), Application('Connection1_RuntimeUserName'), Application('Connection1_RuntimePassword'));
var cmdTmp = Server.CreateObject('ADODB.Command');
var rsTmp = Server.CreateObject('ADODB.Recordset');
cmdTmp.ActiveConnection = DBConn;
rsTmp.Source = cmdTmp;
cmdTmp.CommandType = 2;
cmdTmp.CommandTimeout = 10;
cmdTmp.Prepared = true;
cmdTmp.CommandText = '"BWZL"';
rsTmp.CacheSize = 10;
rsTmp.CursorType = 2;
rsTmp.CursorLocation = 2;
rsTmp.LockType = 3;
Recordset1.setRecordSource(rsTmp);
Recordset1.open();
if (thisPage.getState('pb_Recordset1') != null)
Recordset1.setBookmark(thisPage.getState('pb_Recordset1'));
}
//---------------------------------------------------
從IE里登入SQL里用戶出錯。 可我有指定運行時的用戶名稱。
有資料稱IE登入SQL用戶名會時IUSR_XXXXX
連接不成功﹐啥事也無法做。請各位指教﹗