|
-
May 30th, 2000, 09:50 PM
#1
Thread Starter
Hyperactive Member
I'm wondering what the best method is for intializing a recordset?
-------------------------------------------------------
dim rstCurrent as ADODB.Recordset
set rstcurrent = new ADODB.Recordset
rstcurrent.open ...
-------------------------------------------------------
OR
-------------------------------------------------------
Dim rstCurrent as New ADODB.Recordset
rstCurrent.open ...
-------------------------------------------------------
Thanks
-
May 30th, 2000, 10:13 PM
#2
Member
Hi,
Its better to use first method..i.e., declaring it and afterwards seting that objvariable.
If use the second variable lik...
Dim adoconn as new adodb.connection
after that ur using that obj variable inside ur procedure..onzz u finished everythin u will destroy that varaible which in turns releses memory lik tkis..
adoconn.close
set adoconn=nothing
onzz u given that above statement. it will not releases memory b'coz after this if ur refering again this varaiable lik..
adoconn.cursorlocation=aduseclient
it will automatically look for the first line for refence and it will work . it wont gives u error onzz u destroyed this..so if ur using this user has not having any control over that obj.variable.
if ur using the first method. and setiing the connection to nothing n later if ur referencing that it will gives u error..which user has a control over that variable
so its better to use first method.
hope u clear..anydoubts let me know..
kandan.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|