Groups | Search | Server Info | Login | Register


Groups > comp.lang.basic.visual.database > #9

Re: ADODB.Recordset inaccessible

From The Dubious Khelair <khelair@contract.gateway.2wire.net>
Newsgroups comp.lang.basic.visual.database
Subject Re: ADODB.Recordset inaccessible
Date 2011-09-15 10:55 +0000
Organization A noiseless patient Spider
Message-ID <j4sljv$8kl$1@dont-email.me> (permalink)
References <j4qgih$emi$1@dont-email.me>

Show all headers | View raw


	Okay; as I figured it was a problem that is seeming pretty
foolish.  I haven't been able to try this out yet, but I believe it
sounds like a pretty plausible solution.
	I was under the mistaken impression that my ADODB.Recordset
object was going to slurp in the entire results of my query, and that I
could immediately close the ADODB.Connection object when I was done with
it, being able to later peruse the Recordset object at my leisure.  I've
been informed that this is not the case, however.  I'm not used to this
environment, though; that's really something that I should've tried when
debugging but I didn't even think about it.

The Dubious Khelair <khelair@contract.gateway.2wire.net> wrote:
>        I am working on a project here that has me working with a
> Microsoft SQL database being accessed from an ASP.NET VB page.  Up to
> this point I haven't had any problems connecting to the database;
> however, when I attempt to access what is a valid query in the query
> builder, I am not able to see my ADODB.Recordset object's properties or
> methods as far as I can tell.  This may well be a very foolish mistake,
> as I'm relatively new at Visual Basic and ASP.NET development as a
> whole.

>        Dim strConn, sqlTemp As String
>        Dim objConn, objRecSet
>        objConn = Server.CreateObject("ADODB.Connection")
>        objRecSet = Server.CreateObject("ADODB.Recordset")
> 
>        'credentials
>        strConn = <THIS IS OMITTED BUT FULLY DEBUGGED>
>        objConn.Open(strConn)
> 
>        sqlTemp = "SELECT (Fname, Lname, Employed) FROM " & _
>                Student_Employment" '& _
>        ' "WHERE ProgramMajor = " & _
>                ddlMajorSelection.SelectedItem.ToString
> 
>        Try
>            objRecSet = objConn.execute(sqlTemp)
>            objConn.close()
>        Catch ex As Exception
>            'error running query- do something about it here
>            lblDebugResults.Text = "Error: " & ex.ToString
>        End Try

Back to comp.lang.basic.visual.database | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ADODB.Recordset inaccessible The Dubious Khelair <khelair@contract.gateway.2wire.net> - 2011-09-14 15:17 +0000
  Re: ADODB.Recordset inaccessible The Dubious Khelair <khelair@contract.gateway.2wire.net> - 2011-09-14 15:26 +0000
  Re: ADODB.Recordset inaccessible The Dubious Khelair <khelair@contract.gateway.2wire.net> - 2011-09-15 10:55 +0000
    Re: ADODB.Recordset inaccessible The Dubious Khelair <khelair@contract.gateway.2wire.net> - 2011-09-16 12:54 +0000
  Re: ADODB.Recordset inaccessible Jason Keats <jkeats@melbpcDeleteThis.org.au> - 2011-09-17 18:30 +1000

csiph-web