可以用asp创建DSN吗?

请教
---------------------------------------------------------------

1<html>
2<head>
3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
4<title>ODBC SQL Server @softwing.com</title>
5</head>
6<body bgcolor="#FFFFFF">   

Set xObj = Server.CreateObject("Softwing.OdbcRegTool")
strDriver = "SQL Server"
strDSN = "DSN=New SQL Server Data Source" &amp; vbNullChar &amp; "Description=New SQL Server Data Source" &amp; vbNullChar
strDSN = strDSN &amp; "Server=(local)" &amp; vbNullChar
strDSN = strDSN &amp; "DATABASE=pubs" &amp; vbNullChar &amp; vbNullChar

retval = xObj.CreateDSN(strDriver, strDSN)
If retval = True then
Response.Write "DSN Creation successful."
else
Response.Write "DSN Creation failed."

1</body>
2</html>
Published At
Categories with Web编程
comments powered by Disqus