Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 ADO Constants usage (please read)
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 5

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 03 August 2002 :  06:30:11  Show Profile  Visit D3mon's Homepage
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  Show Profile
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 !
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 05 August 2002 :  04:59:14  Show Profile  Visit D3mon's Homepage
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

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 05 August 2002 :  07:24:15  Show Profile  Visit HuwR's Homepage
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

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 05 August 2002 :  07:25:32  Show Profile  Visit HuwR's Homepage
it is used when updating topic counts in version 3.4

Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  07:39:37  Show Profile
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.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 05 August 2002 :  07:46:00  Show Profile  Visit HuwR's Homepage
I'm not sure.

Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  08:11:53  Show Profile
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.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 05 August 2002 :  08:24:19  Show Profile  Visit HuwR's Homepage
not sure why we don't use the variables instead

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 05 August 2002 :  08:26:16  Show Profile  Visit Gremlin's Homepage
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
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 05 August 2002 :  13:07:08  Show Profile
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.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  13:43:53  Show Profile
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.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 05 August 2002 :  14:21:14  Show Profile
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.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  14:33:10  Show Profile
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.
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 05 August 2002 :  19:35:22  Show Profile  Visit Gremlin's Homepage
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
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  20:13:08  Show Profile
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.
Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07