473,725 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with connection withing dll in debug (XPosted and long)

I have a problem that I am trying to solve. We have a huge product with a
whole lot of ASP and VB code. VB code is all ActiveX dlls which are used by
ASP app. When I attempt to add features or fix bugs, I like to execute the
dlls in debug so I can see what is going on. (Some folks in my org seem to
have this kinda wacky bias against debugging, as if *real* programmers
should not need a debugger. Whatever, it is the fastest way for me to get
the picture.)

This product uses a technique that is different than what I have done in my
projects in the past. If I needed to make a connection to the database, I
would make it, do my work, close it within the narrowest context I could.. a
single sub / function a single class or whatever. This product instead
passes an open connection from the ASP page to a dll. Then, within the dll,
the connection is passed all over the place to various procs.

When running compiled, the dlls run fine. When running in debug mode, when
attempting to use a connection, a runtime error 3001 "Arguments are of the
wrong type, are out of acceptable range, or are in conflict with one
another." The recommended procedure up to this point when having to debug is
to change the offending code to make a new connection to use off the
connection string of the offending object. Then before checking the code in,
change it all back. What a monumental waste of time. So I want to solve this
once and for all. (Then I will be a hero and other pathetic programmers like
me who need to debug will kiss my feet. Ha Ha)

Since the code I am running is fairly complicated, I created a simple app
with one asp page and one activex dll in order to reproduce the problem. The
problem was not reproducable by me. I am clearly missing the vein here.

Thoughts I have at this point:

- The version of ADODB.Connectio n whcih is instantiated in the ASP page is
different than the one in VB. In VB you tell the version you wish in
References. How do I force / know what version is being instantiated in ASP?

- Different auth methods may be being used. Could this impact?

Any other thoughts on what I can pursue to investigate this? I am going to
scream if I have to keep monkeying around with things other than the work I
am trying to get done.

Thanks

Stephanie
Jul 22 '05 #1
3 2520
On Thu, 21 Apr 2005 09:45:14 -0400, "Stephanie" <Iw*********@No Way.com> wrote:

¤ I have a problem that I am trying to solve. We have a huge product with a
¤ whole lot of ASP and VB code. VB code is all ActiveX dlls which are used by
¤ ASP app. When I attempt to add features or fix bugs, I like to execute the
¤ dlls in debug so I can see what is going on. (Some folks in my org seem to
¤ have this kinda wacky bias against debugging, as if *real* programmers
¤ should not need a debugger. Whatever, it is the fastest way for me to get
¤ the picture.)
¤
¤ This product uses a technique that is different than what I have done in my
¤ projects in the past. If I needed to make a connection to the database, I
¤ would make it, do my work, close it within the narrowest context I could.. a
¤ single sub / function a single class or whatever. This product instead
¤ passes an open connection from the ASP page to a dll. Then, within the dll,
¤ the connection is passed all over the place to various procs.
¤
¤ When running compiled, the dlls run fine. When running in debug mode, when
¤ attempting to use a connection, a runtime error 3001 "Arguments are of the
¤ wrong type, are out of acceptable range, or are in conflict with one
¤ another." The recommended procedure up to this point when having to debug is
¤ to change the offending code to make a new connection to use off the
¤ connection string of the offending object. Then before checking the code in,
¤ change it all back. What a monumental waste of time. So I want to solve this
¤ once and for all. (Then I will be a hero and other pathetic programmers like
¤ me who need to debug will kiss my feet. Ha Ha)
¤
¤ Since the code I am running is fairly complicated, I created a simple app
¤ with one asp page and one activex dll in order to reproduce the problem. The
¤ problem was not reproducable by me. I am clearly missing the vein here.
¤
¤ Thoughts I have at this point:
¤
¤ - The version of ADODB.Connectio n whcih is instantiated in the ASP page is
¤ different than the one in VB. In VB you tell the version you wish in
¤ References. How do I force / know what version is being instantiated in ASP?
¤
¤ - Different auth methods may be being used. Could this impact?
¤
¤ Any other thoughts on what I can pursue to investigate this? I am going to
¤ scream if I have to keep monkeying around with things other than the work I
¤ am trying to get done.

How are you actually debugging the components? Are you using VB? ASP?

You have to be very careful about passing ADO Connection objects around. Connections don't marshal
properly across process boundaries so I'm going to assume that all components in the application run
under the same process.

You also have to keep in mind that ASP only understands the Variant data type, which can cause some
headaches when using Visual Basic components. Explicitly typed arguments must be declared ByVal at
the component level in order to be compatible with ASP.
Paul
~~~~
Microsoft MVP (Visual Basic)
Jul 22 '05 #2

"Paul Clement" <Us************ ***********@sws pectrum.com> wrote in message
news:4b******** *************** *********@4ax.c om...
On Thu, 21 Apr 2005 09:45:14 -0400, "Stephanie" <Iw*********@No Way.com>
wrote:

¤ I have a problem that I am trying to solve. We have a huge product with
a
¤ whole lot of ASP and VB code. VB code is all ActiveX dlls which are used
by
¤ ASP app. When I attempt to add features or fix bugs, I like to execute
the
¤ dlls in debug so I can see what is going on. (Some folks in my org seem
to
¤ have this kinda wacky bias against debugging, as if *real* programmers
¤ should not need a debugger. Whatever, it is the fastest way for me to
get
¤ the picture.)
¤
¤ This product uses a technique that is different than what I have done in
my
¤ projects in the past. If I needed to make a connection to the database,
I
¤ would make it, do my work, close it within the narrowest context I
could.. a
¤ single sub / function a single class or whatever. This product instead
¤ passes an open connection from the ASP page to a dll. Then, within the
dll,
¤ the connection is passed all over the place to various procs.
¤
¤ When running compiled, the dlls run fine. When running in debug mode,
when
¤ attempting to use a connection, a runtime error 3001 "Arguments are of
the
¤ wrong type, are out of acceptable range, or are in conflict with one
¤ another." The recommended procedure up to this point when having to
debug is
¤ to change the offending code to make a new connection to use off the
¤ connection string of the offending object. Then before checking the code
in,
¤ change it all back. What a monumental waste of time. So I want to solve
this
¤ once and for all. (Then I will be a hero and other pathetic programmers
like
¤ me who need to debug will kiss my feet. Ha Ha)
¤
¤ Since the code I am running is fairly complicated, I created a simple
app
¤ with one asp page and one activex dll in order to reproduce the problem.
The
¤ problem was not reproducable by me. I am clearly missing the vein here.
¤
¤ Thoughts I have at this point:
¤
¤ - The version of ADODB.Connectio n whcih is instantiated in the ASP page
is
¤ different than the one in VB. In VB you tell the version you wish in
¤ References. How do I force / know what version is being instantiated in
ASP?
¤
¤ - Different auth methods may be being used. Could this impact?
¤
¤ Any other thoughts on what I can pursue to investigate this? I am going
to
¤ scream if I have to keep monkeying around with things other than the
work I
¤ am trying to get done.

How are you actually debugging the components? Are you using VB? ASP?

You have to be very careful about passing ADO Connection objects around.
Connections don't marshal
properly across process boundaries so I'm going to assume that all
components in the application run
under the same process.

You just nailed it. This is the problem. When VB is in debug the dlls are
not run under the same process. Thanks!
You also have to keep in mind that ASP only understands the Variant data
type, which can cause some
headaches when using Visual Basic components. Explicitly typed arguments
must be declared ByVal at
the component level in order to be compatible with ASP.
Paul
~~~~
Microsoft MVP (Visual Basic)

Jul 22 '05 #3
"Stephanie" <Iw*********@No Way.com> wrote in message
news:OK******** ******@TK2MSFTN GP14.phx.gbl...

"Paul Clement" <Us************ ***********@sws pectrum.com> wrote in message
news:4b******** *************** *********@4ax.c om...
On Thu, 21 Apr 2005 09:45:14 -0400, "Stephanie" <Iw*********@No Way.com>
wrote:

¤ I have a problem that I am trying to solve. We have a huge product with a
¤ whole lot of ASP and VB code. VB code is all ActiveX dlls which are used by
¤ ASP app. When I attempt to add features or fix bugs, I like to execute
the
¤ dlls in debug so I can see what is going on. (Some folks in my org seem to
¤ have this kinda wacky bias against debugging, as if *real* programmers
¤ should not need a debugger. Whatever, it is the fastest way for me to
get
¤ the picture.)
¤
¤ This product uses a technique that is different than what I have done in my
¤ projects in the past. If I needed to make a connection to the database, I
¤ would make it, do my work, close it within the narrowest context I
could.. a
¤ single sub / function a single class or whatever. This product instead
¤ passes an open connection from the ASP page to a dll. Then, within the
dll,
¤ the connection is passed all over the place to various procs.
¤
¤ When running compiled, the dlls run fine. When running in debug mode,
when
¤ attempting to use a connection, a runtime error 3001 "Arguments are of
the
¤ wrong type, are out of acceptable range, or are in conflict with one
¤ another." The recommended procedure up to this point when having to
debug is
¤ to change the offending code to make a new connection to use off the
¤ connection string of the offending object. Then before checking the code in,
¤ change it all back. What a monumental waste of time. So I want to solve this
¤ once and for all. (Then I will be a hero and other pathetic programmers like
¤ me who need to debug will kiss my feet. Ha Ha)
¤
¤ Since the code I am running is fairly complicated, I created a simple
app
¤ with one asp page and one activex dll in order to reproduce the problem. The
¤ problem was not reproducable by me. I am clearly missing the vein here. ¤
¤ Thoughts I have at this point:
¤
¤ - The version of ADODB.Connectio n whcih is instantiated in the ASP page is
¤ different than the one in VB. In VB you tell the version you wish in
¤ References. How do I force / know what version is being instantiated in ASP?
¤
¤ - Different auth methods may be being used. Could this impact?
¤
¤ Any other thoughts on what I can pursue to investigate this? I am going to
¤ scream if I have to keep monkeying around with things other than the
work I
¤ am trying to get done.

How are you actually debugging the components? Are you using VB? ASP?

You have to be very careful about passing ADO Connection objects around.
Connections don't marshal
properly across process boundaries so I'm going to assume that all
components in the application run
under the same process.


You just nailed it. This is the problem. When VB is in debug the dlls are
not run under the same process. Thanks!

If you have a windows debugger installed on the web-server ( I use the VC++
debugger ) you can debug the IIS process containing the application. We do
this all the time and, like your app, the dbconnection is typically passed
in from the ASP page so that it does not have to be created and opened
repeatedly on the same page.

1. reset iis
2. launch task manager and identify the instances of DLLHOST.
3. launch your ASP app. This should create a new instance of DLLHOST
4. right-click on the new instance of DLLHOST and select "debug"
5. when the debugger opens you can open the desired source file. You may
have to hit a page that uses your object before you are able to set a
breakpoint.

There are a few drawbacks to this method. The principal one is that the VC
debugger doesn't understand variant arrays well so you may have to add some
debugging variables inside of loops. Also, (this one is weird), parameters
passed in ByRef do not appear to change in the debugger. The values do
actually change but the debugger shows the original value (again
necessitating some additional local variables for debugging).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com

Jul 22 '05 #4

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

Similar topics

1
3789
by: Dmitry Akselrod | last post by:
Hello everyone, I have a vb.net application that wraps the TCPListener object in a class. The server connects to the local interface and establishes itself on port 9900. It then polls for pending connections every 500ms. I also have a vb6 application that uses the WinSock control at the other end of the communication tunel. I have to work with vb6 here because it uses less memory than .NET.
1
4241
by: Rohit Raghuwanshi | last post by:
Hello all, we are running a delphi application with DB2 V8.01 which is causing deadlocks when rows are being inserted into a table. Attaching the Event Monitor Log (DEADLOCKS WITH DETAILS) here. From the log it looks like the problem happens when 2 threads insert 1 record each in the same table and then try to aquire a NS (Next Key Share) lock on the record inserterd by the other thread. Thanks Rohit
6
3250
by: Tom | last post by:
I try to write a simple tcp based job queue server. It's purpose is to get commands from a client and store them in a queue (STL). The server has a thread which checks periodically the queue, executes the commands in it and removes them from the queue after done so. It also has a thread for every client connection. I am using the low level SOCKET API. My server is a Win32 console app and my client is MFC. The followinf struct is passed...
10
3096
by: Parasyke | last post by:
I have a form that I choose from a list of database names and a list within a textbox comes up with the computer ID number and an associated (from a table) user name. Is there a way from looking at this code to tell the network ID name? I hope not to have to write the code with the "Dev Ashish" API code, which I'm sure is great but I can't figure out how to implement it in a form like mine. Please look at the below code and tell if I can...
0
2335
by: jayohare | last post by:
Hello, I have code within my DB application to process credit cards through authorize.net. Ive been using the same code for several years without a problem. I have an order entry computer and after reinstalling Win XP, we used Office/Access 2003. When we try to process CC's we get a debug screen and Access itself crashes. However, the code still runs fine on Access/Office XP. The debug screen says: Method 'doSSLPost' of object...
22
4322
by: b_r | last post by:
Hi, I'm trying to make a simple operation (insert into DB) in VB 2005 and SQL Server. The code is as follows: Dim sConnectionString As String = _ "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DB.mdf....
7
7282
by: Arno R | last post by:
Hi all, I am sending mail from my apps with CDO nowadays. However I have one client where this will not work until now. I am thinking this is related to the provider where the client has his internet-account. I am using cdosys with 'late binding'. I try to send mail with an attachment to a few mailaddresses (strTo) The *exact same code* (with other smtpserver-login and pw strings) does work on various other PC's with various other...
2
2768
by: GaryDean | last post by:
My ASP.Net application, that uses the SQL Membership Provider, runs fine on my development box (server2003) as long as I use the standard provider. But, in anticipation of deployment to other servers I am attempting to register another provider instance. I'm not sure this is the right deployment choice but I haven't found any guidelines on how to best deploy apps using the SQL Membership provider. I first attached...
0
1981
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I could see what is the SQL that freezes the program. I wanted to replicate this for VB.NET, but the SqlConnection object does not seem to support nearly as rich a set of events as the ADODB.Connection object. Any ideas where these events went,...
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9113
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.