昨天有人问如何使用asp创建dsn , 这个就是

发表于:2007-06-30来源:作者:点击数: 标签:
HTML HEAD META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1 TITLEODBC SQL Server @softwing.com/TITLE /HEAD BODY BGCOLOR=#FFFFFF % Set xObj = Server.CreateObject(Softwing.OdbcRegTool) strDriver = SQL Server strDSN = DSN=New
<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 suclearcase/" target="_blank" >ccessful."
else
    Response.Write "DSN Creation failed."
%>
</BODY>
</HTML>



原文转自:http://www.ltesting.net