473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Autodetect CDO

Hi everybody,

Is there a way to detect whether to use CDO (CDOSYS) or CDONTS, depending on
the platform used? Any code sample?

Thanks in advance,

Eric.
Sep 19 '05 #1
8 1642
<%
If CheckObject("CDONTS.NewMail") <> True Then
Response.Write "CDONTS is not available"
Else
Response.Write "CDONTS is available"
End If
If CheckObject("CDO.Configuration") <> True Then
Response.Write "CDO is not available"
Else
Response.Write "CDO is available"
End If

Function CheckObject(sObject)
On Error Resume Next
Set objClass = CreateObject(sObject)
If Err.Number <> 0 then
'// An error occured, return false
CheckObject = False
Else
If IsObject(objClass) Then CheckObject = True
End If
Set objClass = Nothing
End Function
%>
--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Eric Caron" <msnews.microsoft.com> wrote in message
news:#A**************@TK2MSFTNGP15.phx.gbl...
Hi everybody,

Is there a way to detect whether to use CDO (CDOSYS) or CDONTS, depending on the platform used? Any code sample?

Thanks in advance,

Eric.

Sep 19 '05 #2
Eric Caron wrote:
Is there a way to detect whether to use CDO (CDOSYS) or CDONTS,
depending on the platform used? Any code sample?


try {
var Message = Server.CreateObject("CDO.Message")
}
catch(e) { ...repeat as required for CDONTS... }
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Sep 19 '05 #3
Thanks Steven!

I was looking for a more complicated method of identifying the platform, but
your solution is simple et elegant. Is there a reason you would check for
the Configuration object instead of Message?

"Steven Burn" <so*******@in-time.invalid> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
<%
If CheckObject("CDONTS.NewMail") <> True Then
Response.Write "CDONTS is not available"
Else
Response.Write "CDONTS is available"
End If
If CheckObject("CDO.Configuration") <> True Then
Response.Write "CDO is not available"
Else
Response.Write "CDO is available"
End If

Function CheckObject(sObject)
On Error Resume Next
Set objClass = CreateObject(sObject)
If Err.Number <> 0 then
'// An error occured, return false
CheckObject = False
Else
If IsObject(objClass) Then CheckObject = True
End If
Set objClass = Nothing
End Function
%>
--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Eric Caron" <msnews.microsoft.com> wrote in message
news:#A**************@TK2MSFTNGP15.phx.gbl...
Hi everybody,

Is there a way to detect whether to use CDO (CDOSYS) or CDONTS, depending

on
the platform used? Any code sample?

Thanks in advance,

Eric.


Sep 19 '05 #4
Try...Catch only works with .NET tho. This is for an older project. Thanks
for the suggestion.

Eric.

"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
Eric Caron wrote:
Is there a way to detect whether to use CDO (CDOSYS) or CDONTS,
depending on the platform used? Any code sample?


try {
var Message = Server.CreateObject("CDO.Message")
}
catch(e) { ...repeat as required for CDONTS... }
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms. Please do not
contact me directly or ask me to contact you directly for assistance. If
your question is worth asking, it's worth posting.

Sep 19 '05 #5
No specific reason, tis just the object I use when working with CDO ...

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Eric Caron" <msnews.microsoft.com> wrote in message
news:#$**************@TK2MSFTNGP10.phx.gbl...
Thanks Steven!

I was looking for a more complicated method of identifying the platform, but your solution is simple et elegant. Is there a reason you would check for
the Configuration object instead of Message?

"Steven Burn" <so*******@in-time.invalid> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
<%
If CheckObject("CDONTS.NewMail") <> True Then
Response.Write "CDONTS is not available"
Else
Response.Write "CDONTS is available"
End If
If CheckObject("CDO.Configuration") <> True Then
Response.Write "CDO is not available"
Else
Response.Write "CDO is available"
End If

Function CheckObject(sObject)
On Error Resume Next
Set objClass = CreateObject(sObject)
If Err.Number <> 0 then
'// An error occured, return false
CheckObject = False
Else
If IsObject(objClass) Then CheckObject = True
End If
Set objClass = Nothing
End Function
%>
--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Eric Caron" <msnews.microsoft.com> wrote in message
news:#A**************@TK2MSFTNGP15.phx.gbl...
Hi everybody,

Is there a way to detect whether to use CDO (CDOSYS) or CDONTS,
depending on
the platform used? Any code sample?

Thanks in advance,

Eric.



Sep 19 '05 #6
Eric Caron wrote:
Try...Catch only works with .NET tho. This is for an older project.
Thanks for the suggestion.


Incorrect. I use it every single day in classic ASP.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Sep 19 '05 #7
Is it part of the JScript language? It's definitely not part of VBScript.

Mike Ober.

"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
Eric Caron wrote:
Try...Catch only works with .NET tho. This is for an older project.
Thanks for the suggestion.
Incorrect. I use it every single day in classic ASP.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.

Use of this email address implies consent to these terms. Please do not contact me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.


Sep 20 '05 #8
Michael D. Ober wrote:
Is it part of the JScript language? It's definitely not part of
VBScript.


It is.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Sep 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lars | last post by:
As part of an error correction mechanism, I'd like to autodetect ISO-8859-1 vs UTF-8 usage. Where is this described concisely? -Lars
1
by: Grzegorz Kaczor | last post by:
Hello, I wanted to use Response.TransmitFile to return an image instead of a HTML page. Under IE everything works well, but under Mozilla/Firefox the image is treated as it were text/html. ...
2
by: ravisingh11 | last post by:
<authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" timeout="30" cookieless="AutoDetect" /> </authentication> Over here we can specify cookiless to be auto detect so...
1
by: Oscar Thornell | last post by:
Hi, By setting the property "cookieless" (it can take 4 different values...) in the web.config you could control weather an application relies upon cookies or uses the querystring... My...
0
by: BigAl.NZ | last post by:
Hi Guys, I am trying to write/copy some code that uses events with a GPS. Everytime the GPS position updates the event fires. The GPS code is from a SDK Library that I got called GPS Tools...
3
by: Peter | last post by:
Hello! I'm trying to implement a method, that checks spelling of a text and suggests corrections. The C# program looks like: ... Word.Application spellApp = new Word.Application();...
2
latitude
by: latitude | last post by:
Have had a few questions here but no replies so far so thought id give it one more go: Im working on a textviewer/editor and have used autodetect url on it, and it has worked fine. But somewhere...
3
by: =?Utf-8?B?bWdvcHBlcnQ=?= | last post by:
I'm having an issue with using web services in a web application marked with session cookieless attribuet set to "AutoDetect". My real life scenario is too complex to lay out but here's my...
0
by: =?Utf-8?B?bWlrZQ==?= | last post by:
hi: I am getting a blue screen error stop:0xoooooo7b (0xf8aa2524, 0x0000034,0x00000000,0x00000000) I'v tried to change the raid autodetect/ahci to raid autodetect/ata. nothing works and it just...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.