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