问题
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