如何使用ASP创建DSN
类别: ASP教程
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ODBC SQL Server @softwing.com</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
<%
Set xObj = Server.CreateObject("Softwing.OdbcRegTool")
strDriver = "SQL Server"
strDSN = "DSN=New SQL Server Data Source" & vbNullChar & "Description=New SQL Server Data Source" &
vbNullChar
strDSN = strDSN & "Server=(local)" & vbNullChar
strDSN = strDSN & "DATABASE=pubs" & vbNullChar & vbNullChar
retval = xObj.CreateDSN(strDriver, strDSN)
If retval = True then
Response.Write "DSN Creation successful."
else
Response.Write "DSN Creation failed."
%>
</BODY>
</HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ODBC SQL Server @softwing.com</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
<%
Set xObj = Server.CreateObject("Softwing.OdbcRegTool")
strDriver = "SQL Server"
strDSN = "DSN=New SQL Server Data Source" & vbNullChar & "Description=New SQL Server Data Source" &
vbNullChar
strDSN = strDSN & "Server=(local)" & vbNullChar
strDSN = strDSN & "DATABASE=pubs" & vbNullChar & vbNullChar
retval = xObj.CreateDSN(strDriver, strDSN)
If retval = True then
Response.Write "DSN Creation successful."
else
Response.Write "DSN Creation failed."
%>
</BODY>
</HTML>
- 上一篇: 检查来访IP是否合法的实际应用
- 下一篇: ASP定时组件
-= 资 源 教 程 =-
文 章 搜 索