Click to See Complete Forum and Search --> : sql query in asp script blocked


whiteadi
03-13-2003, 05:20 AM
Hi,

I have a query that runs in SQL Query Analyzer for SQL Server 2000 but in script doesn't , it blocks:

Set objRecordsetObjects = Server.CreateObject("ADODB.Recordset")
objRecordsetObjects.CursorType = adOpenKeyset

strSQL = "select e.PK_ORDNER_ID, c.PK_UORDNER_ID, f.DESCRIPTION as ORDNER, c.DESCRIPTION as UNTERORDNER, b.PK_OBJEKT_ID, a.* " & _
" from EPMP_DOCUMENTS_FOLDERS a, EPMP_EREIGNISSE_OBJEKTE b, EPMP_UNTERORDNER c, EPMP_PROJECT_OBJECTTYPES d, EPMP_PROJECT_ORDNER e, EPMP_ACCESSFOLDER f, EPMP_ACCESS_FOLDER g, EPMP_PROJMA h " & _
" where a.PK_DOC_ID = b.FK_DOC_ID " & _
" and b.FK_EREIGNIS_ID = " & strEREIGNIS_ID & _
" and a.FK_UORDNER_ID = c.PK_UORDNER_ID " & _
" and c.FK_POTYPE_ID = d.PK_POTYPE_ID " & _
" and d.FK_ORDNER_ID = e.PK_ORDNER_ID " & _
" and e.FK_ACCESSFOLDER_ID = f.PK_ACCESSFOLDER_ID " & _
" and f.PK_ACCESSFOLDER_ID = g.FK_ACCESSFOLDER_ID " & _
" and g.FK_ACCESSROLE_ID = h.FK_ACCESSROLE_ID " & _
" and h.PK_PROJMA_ID = " & Session("PROJMA_ID") & _
" and g.ACCESSREAD = 1"

if err <> 0 then
Response.Write strSQL
Response.Write err.description
Response.End
end if

objRecordsetObjects.Open strSQL,objConnection, , ,adCmdTable

And here it blocks, the script doesn't go any further.
I have otion explicit and the variables declared with dim, so I repeat strSQL it works in Query Analyzer but not in ASP script.

Thanks,
whiteadi