Fastest way to connect to SQL
Hi,
I am a beginner in database programming. As I am researching, I saw many ways of using ADODB. But I just want to know what is the best way to connect to SQL server. Currently I am using this way:
Set cm = new adodb.command
Set cm.ActiveConnection = cn
cm.CommandText = "sp_GetUsers"
cm.CommandType = adCmdStorProc
cm(0).Direction = adParamReturnValue
cm(1).Value = txtId
cm(2).Value = txtGroup
Set rs = cm.Execute
Everytime I am getting something or querying something from database, I run such kind of code this way. Is this applicable for corporate use if I want to make my program run fast?
Thanks
Re: Fastest way to connect to SQL
The code you have shown is fine, and not just in terms of speed - it will be safer than the alternatives too (as the values from the textboxes are treated as values, rather than potentially being treated as part of the SQL code by mistake).
Re: Fastest way to connect to SQL
Thanks very much for the tip..