Classic ASP SQL Server Database Connection

2020-07-13 10:02发布

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条回答
我命由我不由天
2楼-- · 2020-07-13 10:39

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

%>
查看更多
登录 后发表回答