I have never used code like this before, and am lost on how to output the code to an asp classic page. I tried simply calling the rs("theFile") however, that did not work. It is breaking and giving me an error.
here is the code, with a demo line, to output. I need to put the code the same way it outputs in SSMS, in a Classic ASP page.
Set sqlGetSong = Server.CreateObject("ADODB.Command")
sqlGetSong.ActiveConnection=EV_WikiConn
sqlGetSong.Prepared = true
sqlGetSong.commandtext = "DECLARE @seperator INT;" & vbCrLf & _
"Declare @String nvarchar(max);" & vbCrLf & _
"Declare @Tab TABLE (DT VARCHAR(100));" & vbCrLf & _
"set @String='File_Date_(Jan_21,_1976) / File_Date_(Mar_18,_1996) / File_Date_(Jan_22,_1983) / File_Date_(Jan_20,_1983) / File_Date_(Jan_14,_1976) / File_Date_(Jan_18,_1979) / File_Date_(Dec_18,_1979)';" & vbCrLf & _
"WHILE (CHARINDEX('/', @String, 0) > 0) BEGIN" & vbCrLf & _
"SET @seperator = CHARINDEX('/', @String, 0);" & vbCrLf & _
"INSERT INTO @Tab (DT) SELECT RTRIM(LTRIM(SUBSTRING(@String, 0, @seperator)));" & vbCrLf & _
"SET @String = STUFF(@String, 1, @seperator, '');" & vbCrLf & _
"END" & vbCrLf & _
"INSERT INTO @Tab (DT) SELECT RTRIM(LTRIM(@String));" & vbCrLf & _
"select DT as theFile from" & vbCrLf & _
"(select right(REPLACE(DT,right(DT,7),''),2)DY, right(REPLACE(DT, ')',''), 4)YR, * from @Tab) A" & vbCrLf & _
"order by YR, DY;"
set rsSongs = sqlGetSong.execute
if rsSongs.eof then
' show records here
end if
It gives me an error here:
if rsSongs.eof then
Operation is not allowed when the object is closed.
Can someone please let me know how to output this code to Classic ASP. Thank You Wayne