asp数据库连接

类别:Asp 点击:0 评论:0 推荐:
asp数据库连接
<%

set conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=sqloledb;Network Library=DBMSSOCN;Data Source=127.0.0.1;Initial Catalog=testdb;User Id=sa;Password=;"
'Conn.Open "Data PROVIDER=MSDASQL.1;Driver=SQL Server;Server=localhost;UID=sa;PWD=;Database=testdb"
'Conn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=testdb;Server=temp;"
if err.number<>0 or err then
 err.clear
 response.write Err.Description
 response.end
 %>
 <script language="javascript">
  alert("网络现在繁忙,数据库连接发生错误,请等待几分钟再访问。")
 </script>
<%end if%>

本文地址:http://com.8s8s.com/it/it8011.htm