Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 error in classic asp.net

Author  Topic 

sangi
Starting Member

1 Post

Posted - 2012-02-16 : 04:16:56
I have installed sql server 2008 R2 Express successfully. i have tested sql server 2008 R2 Express database connection with asp.net and working fine.

But i am getting the following error with Classic ASP

Description : Operation is not allowed when the object is closed.
Source : ADODB.Connection

herewith i listed the code with highlighted in yellow color

connString = "Driver={SQL Server}; SERVER=MYSERVER\SQLEXPRESS; Database=MYDB; Uid=sa; Pwd=Pass!@#"

set conn = server.createobject("ADODB.Connection")
set rsuser= server.createobject("ADODB.Recordset")

conn.open connString
sql="SELECT * FROM tbl_test"
rsuser.Open sql,conn,1,2

If Not rsuser.EOF then
response.write "<br>val : "+ rsuser(0)
End if

rsuser.close
set rsuser = nothing
conn.close
set conn = Nothing

Please give me the sample connection string for classic ASP with sql server 2008 R2 Express database connection.

sangi.M

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2012-02-16 : 05:07:00
See ConnectionStrings.com


N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -