当前位置:编程学习 > asp >>

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

答案:<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>



上一个:bbs树型结构的实现方法(二)
下一个:bbs树形结构的实现方法(三)

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,