第一个:dbo权限列出服务器上所有数据库
复制代码 代码如下:
<%
Dim srv
Dim objDB
Set srv = Server.CreateObject("SQLDMO.SQLServer")
srv.LoginTimeout = 15
srv.Connect "127.0.0.1", "lcx", "lcx"
Set objDB = Server.CreateObject("SQLDMO.Database")
%>
<SELECT name="fdatabase">
<%
For Each objDB In srv.Databases
If objDB.SystemObject = False Then
%>
<OPTION><%=objDB.Name%></OPTION>
<%
End If
Next
%>
</select>