ADODB Connection String not working in Classic ASP

两盒软妹~` 提交于 2020-01-06 20:37:18

问题


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

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