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
Previous Page
Author Previous Topic Topic Next Topic
Page: of 5

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 19 August 2002 :  13:21:00  Show Profile
Are you sure? What if the METADATA typelib is loaded in someone's global.asa file? I know on this site, I had to comment out the include for adovbs.inc in the link manager used here for it to work. (we were getting errors about names being redefined).
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 19 August 2002 :  13:26:58  Show Profile
how abput telling people to use 2.5 metadata first, if no luck, try 2.0 instead?
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 August 2002 :  13:33:04  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by RichardKinser

Are you sure? What if the METADATA typelib is loaded in someone's global.asa file? I know on this site, I had to comment out the include for adovbs.inc in the link manager used here for it to work. (we were getting errors about names being redefined).


Well, as I wrote in another post, if the METADATA typelib is loaded in someone's global asa, it will produce a name redefined error. However, IMHO, if that error happened, you could just tell the users to remove the include of adovbs.inc, don't think that can be much of a problem. If this is a solution you do not like, I can understand that, but using the direct values instead of the constants is the only alternative then.

If a decision to include adovbs.inc was made, we could add some info on that on the readme file. It would be a good compromise solution IMO.



Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 19 August 2002 :  14:12:47  Show Profile
quote:
Originally posted by ruirib

[quote]Originally posted by RichardKinser
If a decision to include adovbs.inc was made, we could add some info on that on the readme file. It would be a good compromise solution IMO.



Would you want to include the whole file, or just copy out the sections that are used in the asp code and put them in a separate include?
Go to Top of Page

alex042
Average Member

USA
631 Posts

Posted - 19 August 2002 :  14:57:48  Show Profile  Send alex042 an AOL message  Send alex042 a Yahoo! Message
quote:
Richard maybe you can include adovbs.inc with the code and just include it. That will spare you the changes to the code,that enhance readability. You can even remove the metadata.Including adovbs.inc will work for everyone.


There are some other asp applications that do have this file included. In fact, that was 1 of the 1st errors I had with my portal when I upgraded to v3.4. I had a double call to the library and had to remove 1 of the calls so, since it was easier, I removed a call from outside of the forums. But I'd think it would be better to include the file than not.
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 19 August 2002 :  15:59:37  Show Profile
Here's a trimmed down version of adovbs.inc:

<%
'--------------------------------------------------------------------
' Microsoft ADO
'
' Copyright (c) 1996-1998 Microsoft Corporation.
'
'
'
' ADO constants include file for VBScript
' (This is a trimmed down version with only the required constants)
'
'--------------------------------------------------------------------


on error resume next


'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3


'---- LockTypeEnum Values ----
Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4


'---- ExecuteOptionEnum Values ----
Const adAsyncExecute = &H00000010
Const adAsyncFetch = &H00000020
Const adAsyncFetchNonBlocking = &H00000040
Const adExecuteNoRecords = &H00000080


'---- CommandTypeEnum Values ----
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004
Const adCmdFile = &H0100
Const adCmdTableDirect = &H0200


on error goto 0
%>

Edited by - pweighill on 19 August 2002 17:42:52
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 19 August 2002 :  17:10:26  Show Profile
ok, so we use the trimmed down list that pweighill posted and put it in a file called inc_adovbs.asp and include it on line #1 of config.asp.

Then, in the readme.htm, have something that says if you get an error "name redefined" in the inc_adovbs.asp file, then they just need to delete line #1 from config.asp. Does that sound ok?
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 19 August 2002 :  17:33:09  Show Profile
Not sure if it would work or not but you could put an

on error resume next (at the top of inc_adovbs.asp)
and
on error goto 0 (at the bottom of inc_adovbs.asp)

Would someone who gets the error "name redefined" like to test this?
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 19 August 2002 :  17:41:45  Show Profile
quote:
Originally posted by pweighill

Would someone who gets the error "name redefined" like to test this?



Went and tried it out myself and I got the name redefined error but one I'd put in the on error resume next and on error goto 0 it worked.

I've edited the listing above to include the changes.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 August 2002 :  18:57:53  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by RichardKinser

ok, so we use the trimmed down list that pweighill posted and put it in a file called inc_adovbs.asp and include it on line #1 of config.asp.

Then, in the readme.htm, have something that says if you get an error "name redefined" in the inc_adovbs.asp file, then they just need to delete line #1 from config.asp. Does that sound ok?


Well I'm ok with that. I think the values for CursorLocationEnum could be there also.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 19 August 2002 :  19:18:18  Show Profile
quote:
Originally posted by pweighill

quote:
Originally posted by pweighill

Would someone who gets the error "name redefined" like to test this?



Went and tried it out myself and I got the name redefined error but one I'd put in the on error resume next and on error goto 0 it worked.

I've edited the listing above to include the changes.



You will get the name Redefined Error only if you have the variable redefined. On Error Resume Next is not a good solution to skip the variables, which have been redefined.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 19 August 2002 :  19:24:53  Show Profile
quote:
Originally posted by ruirib

Well I'm ok with that. I think the values for CursorLocationEnum could be there also.

ok, we'll add this one:

'---- CursorLocationEnum Values ----
Const adUseServer = 2
Const adUseClient = 3


(and we need this one also):

'---- GetRowsOptionEnum Values ----
Const adGetRowsRest = -1

Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 19 August 2002 :  21:54:18  Show Profile
will either a 2.5 metadata tag or 2.0 metadata tag work?


<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
<%'<!--METADATA TYPE="TypeLib" uuid={00000200-0000-0010-8000-00AA006D2EA4} -->%>
<%'if you get an error says that .....%>


or there're servers have neigher at all.

Edited by - bjlt on 19 August 2002 22:00:35
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 19 August 2002 :  23:26:56  Show Profile
I don't think that Unix/Linux servers use it, so it doesn't look like the best way to go.
Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Previous 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.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07