Classic ASP SQL Server Database Connection

岁酱吖の 提交于 2020-01-01 10:28:07

问题


I am aiming to create a very basic web based DBMS for Microsoft SQL Server. However, in order to connect to a SQL Server database you seem to require a ODBC connection on the server. Is there any possible way to overcome this?


回答1:


You haven't stated which version of SQLServer but you can use OLEDB connection in ASP.

<%

Dim conn
Set conn = Server.CreateObject("ADODB.Connection")

conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog = Northwind; User Id = sa; Password="

If conn.errors.count = 0 Then   
   Response.Write "Connected OK"
End If

%>


来源:https://stackoverflow.com/questions/2911989/classic-asp-sql-server-database-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!