|
-
Jul 7th, 2009, 10:59 PM
#1
Thread Starter
Member
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
-
Jul 8th, 2009, 06:38 AM
#2
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).
-
Jul 16th, 2009, 03:21 AM
#3
Thread Starter
Member
Re: Fastest way to connect to SQL
Thanks very much for the tip..
Tags for this Thread
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
|