?????? ????? ????? ??? SQL ????? ?? ??????? ?? ??? ????

???? ?????? ???? ??????
???? ID: 169377 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

??????

?? ???? ????? ?? ?? ???? SQL ??????? ??????? ???? ?? ??? ????? ' % ws ' ??? ?? ASP ????????? ActiveX ???? ???????? (ADO), ??? ???? ?? ????? ?? ODBC 3.0 ?? ?????? ?????? ?? ??????? ?? ????



???? ???????

??????? ?????? ??

ODBC ??????? ?????? ????? ?????
?????? ?? ??????? ?? ???? ??? ???????? ??????? ?? ??? ?? ?? ?????? ?? ????? ???? ?? ???? ??? ????????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????:
164221??? ODBC ????????? ??? ??????? ?????? ?? ????? ???? ?? ??? ????

ODBC DSN

ODBC ?????????? ?? ????? ???? ???, ?? ?????? ???? ????? ??? ????? (DSN) ' % ws ' ?? ???????? ?? ?????? Microsoft ??????? ????? ????? (IIS) ??????? ??? ?? ??? ??????? ??? ????????? ????, ?? ???? ??? ??? ?? ???? ????? ???????? ????? ??? ?????? ?? ???, Global.asa ????? ??? Session_OnStart ????? ???, ??????? ??? ?? ??? ??? ????????? ????:
   Session("ConnectionString") =
   "dsn=SQLSysDSN;uid=<username>;pwd=<strong password>;DATABASE=pubs;APP=ASP Script"				
????????? ???? ?? ??? ????? ????????? ???? ???:
  • ?????? DSN ??????? ??? ????????? ??????? ????? ????? ???? ???
  • SQL ????? ??????? ??? Windows NT ?????? ???? ???
  • ??????? ??????? ??? uid ????? ???? ???
??????, SQL ????? ?? ??????? ???? ?? ???? ??, ?? ?? ????? ?????? ????? ??????? ???? ??:

Microsoft OLE DB ??????? ODBC ??????? ?????? '80004005' ?? ???
[Microsoft][ODBC SQL ????? ???????] [SQL Server] ????? ????-??????????: _
????: ?? ??? ??? ???????? ???? ??? ????? ?????????? ??? ????????? SQL ????? ??????? ?? ???

Global.asa

Global.asa ????? ?? ????? ???????? ??? ???? ????? ??, ???????????? ?? ??? ?? ?? ??? ??? ?? ????? ?? ???? ??? ?? ?? ??? ???? ????? ?? ?????????? ASP ????????? ?????? ??? ????? ??????? ??? ???? ?? ???? ??????? ?????????? ??? ??????? ???? ???????, ????? ???? ?? ??? ??? ???????? ????. ???? ??????? ??????????, Global.asa ????? ?????? ???? ?? ?? DSN ????????? ??????? ?????????? ??? ??? ???? ?????? ??????, ?? ??????? ????? ?????? ?????:

Microsoft OLE DB ??????? ODBC ??????? ?????? '80004005' ?? ???
[Microsoft][ODBC ??????? ???????] ???? ????? ?? ??? ???? ???? ?? ????
????????? ???????? ???????

ASP ????????? ??? ???????

????? ?? ??? ??????? ?????? ?? ??? ?? ?? ?????? ????? ????? ?? ??????? ?? ???????? ??????? ????? ?? ???, ????? ????? ??? ?????<Body>????? ?? ??????: </Body>
   <%
   Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
   OBJdbConnection.Open Session("ConnectionString")   %>				
??????? ?? ??? ???? ?? ???, ????? ????? ??? ???? ???:
   <%
   OBJdbConnection.Close
   Set OBJdbConnection = Nothing
   %>				
?? ??? ????? ?? ?????? ????? ??????? ?? ???? ?? ??????? ?????? ??? ?? ???? ?? ???? ??? ??? ?? ??? ??? ???????? ???? ??:

Microsoft OLE DB ??????? ODBC ??????? ?? ??? ?????? '80004005'
[Microsoft][ODBC SQL Server ???????][DBNMPNTW]??????? ??? ???? ????
- ?? -

Microsoft OLE DB ??????? ODBC ?? ??? ??????? ?????? '80004005'
[Microsoft][ODBC SQL Server ???????]????? ???? ??????

???? ?? ????? ????????? ?? ?? ????? ??? ???? ?? Global.asa ?? Authors.asp ???????? ?? ????? ????????? ??? ?????? ?????? ??? ????? ?? pubs ?????? ??? ??? ????????

??? ?? ????????? ???? ?????? UID <username>?? pwd ???? ???? ?? ?? ?? ??? ?? ????? ?? ??? ??? ??? =<strong password=""> . ????? ????????? ???? ?? UID ?? ?? ???????? ???? ?? ??? ???? ?????? ?? ????????

Global.asa</strong></username>
   <SCRIPT LANGUAGE=VBScript RUNAT=Server>
   Sub Session_OnStart
   Session("ConnectionString") =
   "DSN=SQLSysDSN;UID=<username>;PWD=<strong password>;DATABASE=pubs;APP=ASP script"
      Session("ConnectionTimeout") = 15
      Session("CommandTimeout") = 30
   End Sub

   Sub Session_OnEnd

   End Sub
   </SCRIPT>				
Authors.asp
   <HTML>
   <HEAD>
   <TITLE>All Authors</TITLE>
   </HEAD>
   <BODY BGCOLOR="#FFFFFF">

   <% Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
   OBJdbConnection.ConnectionTimeout = Session("ConnectionTimeout")
   OBJdbConnection.CommandTimeout = Session("CommandTimeout")
   OBJdbConnection.Open Session("ConnectionString")
   Set SQLStmt = Server.CreateObject("ADODB.Command")
   Set RS = Server.CreateObject ("ADODB.Recordset")
   %>

   <p>
   <table border="0" bordercolor="#000000">
   <%
   SQLStmt.CommandText = "select * from authors"
   SQLStmt.CommandType = 1
   Set SQLStmt.ActiveConnection = OBJdbConnection
   RS.Open SQLStmt

   Do While Not RS.EOF
   %>
   <TR>
      <TD Width = 150 ALIGN=LEFT>
         <FONT SIZE=+1>
         <%= RS("au_id") %>
         </FONT></TD>
      <TD></TD>
         <TD Width = 150 ALIGN=LEFT>
         <FONT SIZE=+1>
         <%= RS("au_lname")  %>
         </FONT></TD>
      <TD Width = 150 ALIGN=LEFT>
         <FONT SIZE=+1>
         <%= RS("au_fname")  %>
         </FONT></TD>
      <TD Width = 150 ALIGN=LEFT>
         <FONT SIZE=+1>
         <%= RS("phone")  %>
         </FONT></TD>
   </TR>
   <%
   RS.MoveNext
   Loop
   %>
   </table>
   <hr>
   <p>
   </BODY>
   <% OBJdbConnection.Close
   Set OBJdbConnection = Nothing
   %>
   </HTML>				
?????? ????? ????? ?? ???? ??? ???? ??????? ?? ???, Roadmap ????? IIS ????? ?? ASP ????? ????????? ?????? ?????? ?? ?? ???

???

???? ID: 169377 - ????? ???????: 28 ??? 2013 - ??????: 6.0
???? ???? ???? ??:
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 7.0 Standard Edition
  • Microsoft SQL Server 6.5 Standard Edition
  • Microsoft SQL Server 6.0 Standard Edition
  • Microsoft SQL Server 4.21a Standard Edition
  • Microsoft Internet Information Server 3.0
  • Microsoft Internet Information Services 5.0
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Express Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Workgroup Edition
??????: 
kbsqlsetup kbenv kbhowto kbinterop kbtshoot kbmt KB169377 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:169377

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com