I have a database using querydefs for connection to the MS SQL Server back-end, but I want to replace all these with ADODB-connections for security reasons (the database uses a service account with credentials in the connection string, and creating querydefs exposes the passwords so you can easily see it when opening the database file in Notepad or something). I tried clearing the connection string in VBA after each use, but until the database is compacted, the information is still there, so this is not a preferable option. The password is stored in encrypted form in VBA.
Anyway, my problem is that all ADODB approaches that I have tried so far that I managed to get to work were much too slow. I tried looping through a recordset and populating a temporary table with CurrentDB.Execute "INSERT ..." etc which was used as a rowsurce, but this resulted in the main form taking twice the time to open, so I would like to find a better way.
I have also tried populating the combobox using the combobox additem method, but this was much slower still, even for very small tables. I also tried copying the recordset to an array, but that was astonishingly even slower yet.
Does anyone know of an effective way to populate a combobox (or a temporarily table used as the rowsource for a combobox) based on ADODB (or perhaps some other way not involving querydefs)?
Thank you
Anyway, my problem is that all ADODB approaches that I have tried so far that I managed to get to work were much too slow. I tried looping through a recordset and populating a temporary table with CurrentDB.Execute "INSERT ..." etc which was used as a rowsurce, but this resulted in the main form taking twice the time to open, so I would like to find a better way.
I have also tried populating the combobox using the combobox additem method, but this was much slower still, even for very small tables. I also tried copying the recordset to an array, but that was astonishingly even slower yet.
Does anyone know of an effective way to populate a combobox (or a temporarily table used as the rowsource for a combobox) based on ADODB (or perhaps some other way not involving querydefs)?
Thank you