The Recordset Fields property/collection
-
Can anyone remember if there is a performance difference between using a recordset's Fields property or referencing it by default. I thought that I read something about them being different, but I can't find any documentation on it. Please see my example below. Dim rs as ADODB.Recordset dim sText as String ... sText = rs.Fields("MY_TEXT") OR sText = rs("MY_TEXT") I'm using VB6
-
Can anyone remember if there is a performance difference between using a recordset's Fields property or referencing it by default. I thought that I read something about them being different, but I can't find any documentation on it. Please see my example below. Dim rs as ADODB.Recordset dim sText as String ... sText = rs.Fields("MY_TEXT") OR sText = rs("MY_TEXT") I'm using VB6
There shouldn't be any performance difference at all. Are you experiencing any differences? On top of that, using the default proprty is poor programming practice. It just makes your project more difficult to convert to VB.NET in the future. RageInTheMachine9532
-
There shouldn't be any performance difference at all. Are you experiencing any differences? On top of that, using the default proprty is poor programming practice. It just makes your project more difficult to convert to VB.NET in the future. RageInTheMachine9532
Thanks, I'm taking over a contract where the main goal is to clean up the code and make it more maintainable (and get it ready for .NET). I've been primarily working with Java and C++ for the last 4 or 5 years, so things are obviously different. Anyway, I've come across a lot of code that used default properties and before going in there and changin a bunch of stuff I wanted to make sure I had good reason. Thanks.