Author |
Topic |
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 03 August 2002 : 06:30:11
|
Wherever you find a line like: > my_Conn.Execute (strSql)
add ', ,&H00000080' to the line as follows: > my_Conn.Execute (strSql), ,&H00000080
Apparently, this stops the database trying to build and return a recordset and (I think!) has given some speed improvement to my forums.
Note: It can't be added to a call that actually does return a recordset like: > set rs = my_Conn.Execute (strSql)
What do you all think?
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 03 August 2002 : 20:19:03
|
In 3.4 most of our queries look like this:Set rsChk = Server.CreateObject("ADODB.Recordset") rsChk.open strSql, my_Conn, 0, 1, &H0001
«-----------------------------------» Join the Snitz Forums WebRing ! |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 05 August 2002 : 04:59:14
|
I believe the &H0001 tells the system that 'strSql' contains a string of SQL commands which is correct, but I also believe that it is the 'default' setting for a connection of that type.
If the connection is for a change to the database (where there is no recordset returned) the addition of &H00000080 in its place, tells the system 'dont worry about trying to create a recordset for this one as we're not expecting any results' which apparently gives some significant improvement in connections of that type.
D3mon
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 05 August 2002 : 07:24:15
|
D3mon,
what you are doing is passing a flag called adExecuteNoRecords which stops the database from returning results which as you say will improve data update queeries which do not require a result
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 05 August 2002 : 07:25:32
|
it is used when updating topic counts in version 3.4
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 05 August 2002 : 07:39:37
|
quote:
In 3.4 most of our queries look like this:
... rsChk.open strSql, my_Conn, 0, 1, &H0001
The above statement is equivelant to the statement as below:
rsChk.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
Any particular reason the built in vbConstants are not used, I believe they are more descriptive.
www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 05 August 2002 : 07:46:00
|
I'm not sure.
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 05 August 2002 : 08:11:53
|
quote:
I'm not sure.
About?
If you mean, whether the statements are equivelant or not, you may refer to the link below: http://msdn.microsoft.com/code/default.asp?url=/msdn-files/026/002/148/ASP/WebSite/adohelper_asp.asp
However I see the use of following statements in the code mentioned at the link above
REM -- ADO command types const adCmdText = 1
REM -- ParameterDirectionEnum Values const adParamUnknown = &H0000 const adParamInput = &H0001
www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 05 August 2002 : 08:24:19
|
not sure why we don't use the variables instead
|
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 05 August 2002 : 08:26:16
|
Would be nice to see the ado constants used instead of hardcoding the values, but either way doesn't bother me too much.
www.daoc-halo.com |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 05 August 2002 : 13:07:08
|
we are not using the variables because they would cause problems.
For instance, on this site we had them defined in global.asa, and then defining them again in the code caused an error.
On my server I have them defined in the global.asa file as well, and to use Table Editor on my server, I have to comment out 20 - 30 lines in one of the files for it to work. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 05 August 2002 : 13:43:53
|
quote:
we are not using the variables because they would cause problems.
For instance, on this site we had them defined in global.asa, and then defining them again in the code caused an error.
On my server I have them defined in the global.asa file as well, and to use Table Editor on my server, I have to comment out 20 - 30 lines in one of the files for it to work.
You need not to define the ADO Constants, you can declare a type library in your Global.asa file to use the defined constants in any .asp file in an application.
To declare a type library, <METADATA> tag can be used in .asp file or Global.asa file.
Syntex For the ADO type library:
<!--METADATA NAME="Microsoft ActiveX Data Objects 2.5 Library" TYPE="TypeLib" UUID="{00000205-0000-0010-8000-00AA006D2EA4}"-->
Or, rather than referring to the type library's universal unique indentifier (UUID), you can also refer to the type library by file path:
<!-- METADATA TYPE="typelib" FILE="c:\program files\common files\system\ado\msado15.dll"-->
As for the TableEditoR the ADO Constants are defined in te_includes.asp(Latest Version) which is included in the te_config.asp. Almost all those Const Statemens can be replaced with reference to Type Library.
If TableEditor is part of the same web then just comment out or remove the const statements in te_includes.asp, the reference to Type Library in global.asa will work for TableEditor also.
IMHO
www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 05 August 2002 : 14:21:14
|
this is what I used in my global.asa file:
<!--METADATA TYPE="TypeLib" uuid={00000200-0000-0010-8000-00AA006D2EA4} -->
and it's used on this site as well.
But, we can't expect that everyone will have this in their global.asa file. So, there is no way that we can use the ADO constants and make sure that everyone will be able to use them without errors. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 05 August 2002 : 14:33:10
|
It can be added in config.asp.
www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 05 August 2002 : 19:35:22
|
If you put the metatag in config.asp then there should be no errors, even if it is already also defined in global.asa I believe.
www.daoc-halo.com |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 05 August 2002 : 20:13:08
|
Yes, It won't give any errors.
www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Topic |
|