ASP calling a DLL Problem!!

This is a discussion on "ASP calling a DLL Problem!!" within the Classic ASP section. This forum, and the thread "ASP calling a DLL Problem!! are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Aug 18th, 2004, 14:17
New Member
Join Date: Aug 2004
Location: United Kingdom
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
ASP calling a DLL Problem!!

Hello,
I'm fairly new to ASP..

I'm trying to call a DLL witten in VB [in winnt\system32] which accesses an Oracle database.
The DLL has worked fine for many years when accessed by VB front-end apps.
However, when making a call from ASP [using VBScript], my web page just seems to hang.

Here's the ASP code which calls the DLL:
set objADODb = Server.CreateObject("AAH_ADO2.CADODatabase")
set objADOEng = Server.CreateObject("AAH_ADO2.CADOEngine")

dim dbEng
dim dbMain
set dbEng = objADOEng
set dbMain = objADODb

dbEng.Initialise

If dbEng.CMOpenDBClientCursor(9, 0, 3, "") = 0 Then
Set dbMain = dbEng.GetDatabase(9)
End If

....It's the call to CMOpenDBClientCursor which seems to be hanging.. this function simply creates a connection object for an oracle db.
I can connect to the db directly within ASP using the ADO Connection stuff.

Any ideas would be appreciated...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Aug 18th, 2004, 15:00
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,192
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Hi Jason.... without actually seeing the VB object source, it would be pretty hard for me to
take a stab at what is wrong here.

I can see that you have a little more code than nessessary, although cant see that would cause this error... you could try this:-
Code: Select all
set dbMain = Server.CreateObject("AAH_ADO2.CADODatabase")
set dbEng = Server.CreateObject("AAH_ADO2.CADOEngine")

dbEng.Initialise

If dbEng.CMOpenDBClientCursor(9, 0, 3, "") = 0 Then
Set dbMain = Nothing 'Does this object have a 'close' method?
Set dbMain = dbEng.GetDatabase(9)
End If
Have you tried calling the object with just 'createobject' as opposed to server.createobject ... I've seen some objects that were not specifically design as IIS accessible COM objects only work this way.

Let us know how you get on.

Rob
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Aug 18th, 2004, 15:17
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
If dbEng.CMOpenDBClientCursor(9, 0, 3, "") = 0 Then

...its a golden rule of ASP not to use magic numbers!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Aug 18th, 2004, 15:23
New Member
Join Date: Aug 2004
Location: United Kingdom
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
<blockquote id="quote" class="ffs">quote:<hr height="1" noshade="noshade" id="quote" />Originally posted by Rob
Hi Jason.... without actually seeing the VB object source, it would be pretty hard for me to
take a stab at what is wrong here.

I can see that you have a little more code than nessessary, although cant see that would cause this error... you could try this:-
Code: Select all
set dbMain = Server.CreateObject("AAH_ADO2.CADODatabase")
set dbEng = Server.CreateObject("AAH_ADO2.CADOEngine")

dbEng.Initialise

If dbEng.CMOpenDBClientCursor(9, 0, 3, "") = 0 Then
Set dbMain = Nothing 'Does this object have a 'close' method?
Set dbMain = dbEng.GetDatabase(9)
End If
Have you tried calling the object with just 'createobject' as opposed to server.createobject ... I've seen some objects that were not specifically design as IIS accessible COM objects only work this way.

Let us know how you get on.

Rob<hr height="1" noshade="noshade" id="quote" /></blockquote id="quote">
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Aug 18th, 2004, 15:34
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,192
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Hi Jason.....

Could you not use a table of constants, instead of those mysterious numbers in function calls?

It would be a nightmare for other developers to pick up your code otherwise.... it would also make your life easier.

I presume those numbers roughly map to ADO constants such as adOpenStatic etc, etc
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Aug 18th, 2004, 15:40
New Member
Join Date: Aug 2004
Location: United Kingdom
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry... it was just a frig in the ASP...
The call in the ASP should read:
Code: Select all
If dbEng.CMOpenDBClientCursor(giCM_AAH_PS_NAMEKEY, _
                                  False, _
                                  adModeReadWrite, _
                                  "") = giCM_RSLT_OK Then ......
where you can ignore 'giCM_AAH_PS_NAMEKEY'

Jason
<blockquote id="quote" class="ffs">quote:<hr height="1" noshade="noshade" id="quote" />Originally posted by Rob
Hi Jason.....

Could you not use a table of constants, instead of those mysterious numbers in function calls?

It would be a nightmare for other developers to pick up your code otherwise.... it would also make your life easier.

I presume those numbers roughly map to ADO constants such as adOpenStatic etc, etc<hr height="1" noshade="noshade" id="quote" /></blockquote id="quote">
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
asp, calling, dll, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem calling function via onClick Eagle JavaScript Forum 5 Jan 15th, 2007 21:41
Calling all CSS guru's! csa Web Page Design 6 Mar 8th, 2006 08:28
calling .exe benbacardi Flash & Multimedia Forum 4 Dec 19th, 2004 16:45


All times are GMT. The time now is 03:50.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42