问题
I have been developing an ASP.NET application. I want to integrate Classic ASP file(.asp) in this application.
In a .asp file I have to fetch data from SQL Server 2008 r2 database. For this I have created db and rs object. I have passed ConnectionString in db.Open function. But I am getting no output for this code.
Following is my code
set db = Server.CreateObject("ADODB.Connection")
db.Open "provider=SQLNCLI10;Data Source=HP-PC\SQLEXPRESS;Initial Catalog=RMToday;Persist Security Info=True;"
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "select * from RMToday.dbo.[Current]",db
if not rs.EOF Then
response.Write(rs("DayClosed"))
End If
I have searched in stackoverflow.com and got some related questions, answer.
I can not understand the wrong in this code.
Thanks in advance
来源:https://stackoverflow.com/questions/32206939/adodb-connection-string-not-working-in-classic-asp