Hallo!
Ich meine Funktion und Anwendung m�ssten so lauten:
dim rs
rs = GetRS("...sql...")
...
...
function GetRS(pSQL)
dim lRS
set lRS = Server.CreateObject("ADODB.Recordset")
lRS.CursorLocation = adUseClient
lRS.CursorType = adOpenStatic
lRS.LockType = adLockReadOnly
lRS.Open pSQL, ConnectionString
set lRS.ActiveConnection = nothing
GetRS = lRS
lRS.Close
set lRS = nothing
end function
So erh�lt das rufenden Programm ein voll funktionsf�higes Recordset ohne
Connection. Aber was sagst Du dazu?
Freundliche Gr��e
Joachim van de Bruck
> Nein, wieso sollte ich das Recordset schliessen bevor ich es benutzt
> habe?
>
>
> z.B. so:
>
> Dim rs
> Set rs = getDisconnectedRS(connectioString,"SELECT * from tabel WHERE
> ...")
> 'rs benutzen...
> ....
> ....
> ' .. Und schliessen
> rs.close
> Set rs = Nothing
>
> Claudius
>
> >
> >
> > Hallo!
> >
> > > Das Recordset soll ja auch nicht geschlossen werden, sondern die
> > > Connection...
> > >
> > > Hier ist meine funktion:
> > >
> > >
> > > function getDisconnectedRS(connection,sql)
> > > dim dRS
> > > Set dRS = Server.CreateObject("ADODB.Recordset")
> > > dRS.CursorLocation = adUseClient
> > > dRS.Open sql, connection, adOpenStatic, adLockBatchOptimistic
> > > Set dRS.ActiveConnection = Nothing
> > > Set getDisconnectedRS = dRS
> > > end function
> >
> > Fehlt da nicht noch so etwas wie "dRS.Close" und "set dRS =
nothing"?
> > Oder vertraust Du darauf, dass das mit "end function" sofort
> > geschieht?
> >
> > Freundliche Gr��e
> > Joachim van de Bruck
> >
> >
> >
> >
> > | [aspdedatabase] als [EMAIL PROTECTED] subscribed
> > | http://www.aspgerman.com/archiv/aspdedatabase/ = Listenarchiv
> > | Sie k�nnen sich unter folgender URL an- und abmelden:
> > |
http://www.aspgerman.com/aspgerman/listen/anmelden/aspdedatabase.asp
> >
>
>
> | [aspdedatabase] als [EMAIL PROTECTED] subscribed
> | http://www.aspgerman.com/archiv/aspdedatabase/ = Listenarchiv
> | Sie k�nnen sich unter folgender URL an- und abmelden:
> | http://www.aspgerman.com/aspgerman/listen/anmelden/aspdedatabase.asp
| [aspdedatabase] als [email protected] subscribed
| http://www.aspgerman.com/archiv/aspdedatabase/ = Listenarchiv
| Sie k�nnen sich unter folgender URL an- und abmelden:
| http://www.aspgerman.com/aspgerman/listen/anmelden/aspdedatabase.asp