Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Asp-sqldb help


Message #1 by sven@h... on Thu, 12 Sep 2002 05:24:58
I received a site that uses (1) call for oledb and another for odbc. The 
shop that I work for does not allow dsn for odbc. Part of the code hangs 
because of this.....
set rst = cmd.Execute

  do while NOT rst.EOF
    if OrgType = "Artist" then
      intID = rst.Fields("ArtistID")
      strName = rst.Fields("FirstName") + " " + rst.Fields("LastName")
    elseif OrgType = "ArtsOrg" then
      intID = rst.Fields("ArtsOrgID")
      strName = rst.Fields("Organization")
    elseif OrgType = "Teacher" then
      intID = rst.Fields("TeacherID")
      strName = rst.Fields("FirstName") + " " + rst.Fields("LastName")
    else 'Schools
      intID = rst.Fields("SchoolID")
      strName = rst.Fields("SchoolName")
    end if
   
    if SearchType = "Keyword" then
      strMatchList = Left(rst.Fields("MatchList"), Len(rst.Fields
("MatchList")) - 2)
      Score = cint(rst.Fields("Score"))
    end if

    if SearchType = "Find" then
      strEmail = rst.Fields("Email")
    end if
    
    if strStyle = "" then
      strStyle = " "
    end if
  
%>

<% Count = Count + 1 %>

<% if Count = 1 then %>
  <%if SearchType = "Keyword" then%>
and returns 
ADODB.Recordset error '800a0e78' 

Operation is not allowed when the object is closed. 

Can any give any insight to this?
Thank you for your time in advance.
Message #2 by "Ken Schaefer" <ken@a...> on Thu, 12 Sep 2002 17:00:41 +1000
Which line causes the code to generate the error?

I would suspect that you need SET NOCOUNT ON inside your sproc, as it is
returning "xx records affected" *before* it is returning the records you
think it is.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <sven@h...>
Subject: [asp_databases] Asp-sqldb help


: I received a site that uses (1) call for oledb and another for odbc. The
: shop that I work for does not allow dsn for odbc. Part of the code hangs
: because of this.....
: set rst = cmd.Execute
:
:   do while NOT rst.EOF
:     if OrgType = "Artist" then
:       intID = rst.Fields("ArtistID")
:       strName = rst.Fields("FirstName") + " " + rst.Fields("LastName")
:     elseif OrgType = "ArtsOrg" then
:       intID = rst.Fields("ArtsOrgID")
:       strName = rst.Fields("Organization")
:     elseif OrgType = "Teacher" then
:       intID = rst.Fields("TeacherID")
:       strName = rst.Fields("FirstName") + " " + rst.Fields("LastName")
:     else 'Schools
:       intID = rst.Fields("SchoolID")
:       strName = rst.Fields("SchoolName")
:     end if
:
:     if SearchType = "Keyword" then
:       strMatchList = Left(rst.Fields("MatchList"), Len(rst.Fields
: ("MatchList")) - 2)
:       Score = cint(rst.Fields("Score"))
:     end if
:
:     if SearchType = "Find" then
:       strEmail = rst.Fields("Email")
:     end if
:
:     if strStyle = "" then
:       strStyle = "&nbsp;"
:     end if
:
: %>
:
: <% Count = Count + 1 %>
:
: <% if Count = 1 then %>
:   <%if SearchType = "Keyword" then%>
: and returns
: ADODB.Recordset error '800a0e78'
:
: Operation is not allowed when the object is closed.
:
: Can any give any insight to this?
: Thank you for your time in advance.


Message #3 by sven@h... on Thu, 12 Sep 2002 23:39:05
> I received a site that uses (1) call for oledb and another for odbc. 
The 
s> hop that I work for does not allow dsn for odbc. Part of the code 
hangs 
b> ecause of this.....
s> et rst = cmd.Execute

>   do while NOT rst.EOF
 >    if OrgType = "Artist" then
 >      intID = rst.Fields("ArtistID")
 >      strName = rst.Fields("FirstName") + " " + rst.Fields("LastName")
 >    elseif OrgType = "ArtsOrg" then
 >      intID = rst.Fields("ArtsOrgID")
 >      strName = rst.Fields("Organization")
 >    elseif OrgType = "Teacher" then
 >      intID = rst.Fields("TeacherID")
 >      strName = rst.Fields("FirstName") + " " + rst.Fields("LastName")
 >    else 'Schools
 >      intID = rst.Fields("SchoolID")
 >      strName = rst.Fields("SchoolName")
 >    end if
 >   
 >    if SearchType = "Keyword" then
 >      strMatchList = Left(rst.Fields("MatchList"), Len(rst.Fields
(> "MatchList")) - 2)
 >      Score = cint(rst.Fields("Score"))
 >    end if

>     if SearchType = "Find" then
 >      strEmail = rst.Fields("Email")
 >    end if
 >    
 >    if strStyle = "" then
 >      strStyle = "&nbsp;"
 >    end if
 >  
%> >

> <% Count = Count + 1 %>

> <% if Count = 1 then %>
 >  <%if SearchType = "Keyword" then%>
a> nd returns 
A> DODB.Recordset error '800a0e78' 

> Operation is not allowed when the object is closed. 

> Can any give any insight to this?
T> hank you for your time in advance.

  Return to Index