Ask a Question related to ASP Database, Design and Development.
-
Jen #1
no records
Hi,
I am writing a jsp page to get data from db.
<%@ Language=VBScript %>
<!-- #include file="ConnString.asp" -->
<html>
<head>
</head>
<body>
<%
dim rsLook
dim sSql
dim arResults
dim i
Set objCon = server.createobject("adodb.connection")
objCon.open strConnString
sSql = "SELECT * FROM table1" & _
" (NOLOCK) " & _
"WHERE sIdentifier01 = '19931573'"
set rsLook = Server.CreateObject("ADODB.Recordset")
Response.Write "SQL: " & sSql
rsLook.Open sSql, objCon, , ,adCmdText
if Not rsLook.EOF then
arResults=rsLook.GetRows
End if
'the recordset is no longer needed, so:
rsLook.close:set rsLook = nothing
'if the connection is no longer needed, kill it now:
ObjCon.close:set ObjCon=nothing
If IsArray(arResults) then
Response.Write "<p>This table currently has <strong>"
& _
"<font color=""#FF0000"">"
Response.Write Ubound(arResults,2) + 1
Response.Write "</font</strong> records."
else
Response.Write " No records were returned"
end if
%>
test
</body>
</html>
I got "No records were returned", but when I run the same
sql in EM it returns a record. I have no idea how to debug
it. Please help.
Jen Guest
-
Group and Sum records
Team,Score,Team,Score A,4,B,3 B,5,C,2 C,3,D,1 D,3,A,5 I have those 4 records in a database - I need to have them summarized like this: ... -
navigating through records
Using asp/ado/IE: Let say I have a recordset contianing 1000 records. I don't want to show *all* 1000 records in one long table on a page so how do... -
DNS text records ?
I'm having some trouble finding a way to query a specific dns server for the text record of a given name purely in perl. I'm trying to do this with... -
DNS SRV Records?
Hi, how can I query DNS SRV records with ruby? regards Hadmut -- Hadmut Danisch http://www.danisch.de -
Filtering records
Hi: I need to build an ASP query to search a property size that is between minimum and maximum values (in two text boxes in a form). Here is the... -
Bob Barrows #2
Re: no records
Jen wrote:
Show us the result of> Hi,
> I am writing a jsp page to get data from db.
>
>
> sSql = "SELECT * FROM table1" & _
> " (NOLOCK) " & _
> "WHERE sIdentifier01 = '19931573'"
> set rsLook = Server.CreateObject("ADODB.Recordset")
> Response.Write "SQL: " & sSql
>
> I got "No records were returned", but when I run the same
> sql in EM it returns a record. I have no idea how to debug
> it. Please help.
Response.Write "SQL: " & sSql
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest
-
Jen #3
Re: no records
thanks
the sql output is
SELECT * FROM table1 (NOLOCK) WHERE sIdentifier01
= '19931573'
same>-----Original Message-----
>Jen wrote:>> Hi,
>> I am writing a jsp page to get data from db.
>>
>>
>> sSql = "SELECT * FROM table1" & _
>> " (NOLOCK) " & _
>> "WHERE sIdentifier01 = '19931573'"
>> set rsLook = Server.CreateObject("ADODB.Recordset")
>> Response.Write "SQL: " & sSql
>>
>> I got "No records were returned", but when I run thedebug>> sql in EM it returns a record. I have no idea how tospam trap so I>>> it. Please help.
>Show us the result of
>Response.Write "SQL: " & sSql
>
>Bob Barrows
>--
>Microsoft MVP - ASP/ASP.NET
>Please reply to the newsgroup. This email account is mythen remove the>don't check it very often. If you must reply off-line,>"NO SPAM"
>
>
>.
>Jen Guest
-
Bob Barrows #4
Re: no records
Jen wrote:
And this query returns records when run without modification in Query> thanks
> the sql output is
>
> SELECT * FROM table1 (NOLOCK) WHERE sIdentifier01
> = '19931573'
Analyzer? What is the datatype of the sIdentifier01 column?
Is this table normalized? The "01" makes me nervous.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest
-
Jen #5
Re: no records
this is query returns 1 record. sIdentifier01 is the
primary key and type char.
thanks
modification in Query>-----Original Message-----
>Jen wrote:>>> thanks
>> the sql output is
>>
>> SELECT * FROM table1 (NOLOCK) WHERE sIdentifier01
>> = '19931573'
>And this query returns records when run withoutcolumn?>Analyzer? What is the datatype of the sIdentifier01spam trap so I>
>Is this table normalized? The "01" makes me nervous.
>
>Bob Barrows
>--
>Microsoft MVP - ASP/ASP.NET
>Please reply to the newsgroup. This email account is mythen remove the>don't check it very often. If you must reply off-line,>"NO SPAM"
>
>
>.
>Jen Guest
-
Bob Barrows #6
Re: no records
I think you need to run a trace using SQL Profiler to see what statement is
actually being sent to the database. SQL Profiler can be found in the SQL
Server program group. Just open it, connect to the server and run the trace
while executing the asp page. Look in the trace to see the sql statement
being sent to the database and tell us what it is.
Bob Barrows
Jen wrote:> this is query returns 1 record. sIdentifier01 is the
> primary key and type char.
>
> thanks
>>> -----Original Message-----
>> Jen wrote:>>>>> thanks
>>> the sql output is
>>>
>>> SELECT * FROM table1 (NOLOCK) WHERE sIdentifier01
>>> = '19931573'
>> And this query returns records when run without modification in Query
>> Analyzer? What is the datatype of the sIdentifier01 column?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows Guest



Reply With Quote

