извините за мой английский.
я использую классический asp и пробую открыть набор записей следующим запросом
query = "SELECT "+_
"op.""ID"","+_
"replace(op.""FIO"",'""','\""') AS FIO, "+_
"replace(op.""Fax"",'""','\""') AS Fax, "+_
"replace(p.""Phone"",'""','\""')AS Phone, "+_
"replace(p.""INN"",'""','\""') AS INN, "+_
"replace(v.""ParentID"",'""','\""') AS ParentID, "+_
"replace(v.""Name"",'""','\""') AS Name, "+_
"replace(v.""ShortName"",'""','\""') AS ShortName, "+_
"replace(v.""AddIndex"",'""','\""') AS AddIndex, "+_
"replace(v.""StateID"",'""','\""') AS StateID, "+_
"replace(coalesce(p.""Address"",op.""LawAddress""),'""','\""') as ""Address"", "+_
"replace(coalesce(p.""ZIPCode"",op.""LawZIPCode""),'""','\""') as ""ZIPCode"", "+_
"replace(coalesce(p.""Country"",op.""LawCountry""),'""','\""') as ""Country"", "+_
"replace(coalesce(p.""Oblast"",op.""LawOblast""),'""','\""') as ""State"", "+_
"replace(coalesce(p.""City"",op.""LawCity""),'""','\""') as ""City"", "+_
"replace(coalesce(p.""Address"",op.""LawAddress""),'""','\""') as ""Street"", "+_
"replace(coalesce(p.""House"",op.""LawHouse""),'""','\""') as ""House"", "+_
"replace(op.""LawOffice"",'""','\""') as ""Office"""+_
" FROM "+_
" DBO.""LDOrgPartner"" op, "+_
" DBO.""LDPartner"" p, "+_
" DBO.""LDVocabulary"" v "+_
" WHERE "+_
" p.""ID""=op.""ID"" AND "+_
" v.""ID""=op.""ID"" AND "+_
" v.""ObjectTypeID"" in (19,44) "&wherePart
response.Write(query)
Set rs = Server.CreateObject("ADODB.Recordset")
rs.PageSize=1000
rs.Open query, con
where wherePart="AND p."INN" LIKE '%38%'"
все работает нормально, но если wherePart=" AND v."ShortName" LIKE '%ооо%'"
, количество записей в наборе равно -1. Выполнение запроса с wherePart=" AND v."ShortName" LIKE '%ооо%'"
в Management studio возвращает 900 строк