Link to home
Start Free TrialLog in
Avatar of tjeffryes
tjeffryesFlag for United States of America

asked on

deploy adodb.dll on commercial hosted server

Okay, so I hope y'all will bear with me.

I'm asking 2 questions.  One is high level and I don't really expect anyone to "tutor" me in this setting.  However, I ask it so that my 2nd question makes more sense.
In general let me state that I'm a professional VBA developer and I generally work on single-machine development.  Thus, any time I get involved in distributed applications or things like web sites, I tend to get a little confused.

But I have to learn this .NET business, so I'm experimenting.  For learning purposes, I made a very nice web service that has math functionality.  One function adds 2 numbers.  Another multiplies 2 numbers.  Then I created a string function that concatenates 2 strings.  

Then I thought I'd get creative and write something that pulls from a database.  I'm familiar with ADO and I know I can use Server.CreateObject(), but I wanted to use the nifty features of .NET, so I tried adding a reference to the web service.  I went to Website > Add Reference.  I was presented with a dialog and was given "adodb" as a choice, so I chose that.

I then tried to compile the web service and I got

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 25:             <compilation debug="true" strict="false" explicit="true" urlLinePragmas="true">
Line 26:                   <assemblies>
Line 27:                         <add assembly="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
Line 28:             <pages>
Line 29:                   <namespaces>
 
I checked the config file and indeed the line mentioned above had been added.

Now I'm assuming that that particular version of adodb.dll is not on my host machine.  
See, the real gotcha here is that I'm trying to do this on a commercial hosting account.  The account has .NET 2.0 installed, so that's not a problem.  But as a commercial web host, I don't really have access to the operating system and I don't even know if I have the ability to install DLLs or ask them to.

So, my high level question is:  Am I doing this all wrong and can it be stated as a general rule of thumb that you can't do things like add references when you're working with a commercial host that does not give you the full capability of working with the operating system?

My lower level question is:  "Can I install this adodb.dll" on  the host by simply copying it somewhere that my config file can get to it?  Or, as with the higher level question, do I stay away from creating references and simply use old fashioned ADO?

I did try to copy C:\Program Files\Microsoft.NET\Primary Interop Assemblies\adodb.dll to the web service folder and any subfolder that it uses.  I noticed the version # was different than that in the config file, so I tried compiling with the old version # and the new version #.  Neither worked.

thanks in Advance.

Okay, I just thought of something else:  I'm also attempting to do all this directly on the hosting account.  Is the proper way to do it to develop it on my own machine (with IIS) and then once it's working, somehow deploy it to the commercial server?  If so, does this mean I have to make all my connection strings identical between my home machine and the host machine or do I just tweak those once I deploy?
<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
	<appSettings/>
	<connectionStrings/>
	<system.web>
		<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
 
            Visual Basic options:
            Set strict="true" to disallow all data type conversions 
            where data loss can occur. 
            Set explicit="true" to force declaration of all variables.
        -->
		<compilation debug="true" strict="false" explicit="true" urlLinePragmas="true">
			<assemblies>
				<add assembly="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
		<pages>
			<namespaces>
				<clear/>
				<add namespace="System"/>
				<add namespace="System.Collections"/>
				<add namespace="System.Collections.Specialized"/>
				<add namespace="System.Configuration"/>
				<add namespace="System.Text"/>
				<add namespace="System.Text.RegularExpressions"/>
				<add namespace="System.Web"/>
				<add namespace="System.Web.Caching"/>
				<add namespace="System.Web.SessionState"/>
				<add namespace="System.Web.Security"/>
				<add namespace="System.Web.Profile"/>
				<add namespace="System.Web.UI"/>
				<add namespace="System.Web.UI.WebControls"/>
				<add namespace="System.Web.UI.WebControls.WebParts"/>
				<add namespace="System.Web.UI.HtmlControls"/>
			</namespaces>
		</pages>
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authentication mode="Windows"/>
		<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.
 
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
	</system.web>
</configuration>

Open in new window

Avatar of corptech
corptech
Flag of United States of America image

Try copying the adodb.dll file to your bin directory and then add a reference to that file.  You can to this either by clicking on the references in the solution explorer, selecting adodb and changing 'copy local' to true or by manually copying the file and setting the reference by clicking on add reference and browsing to the copied file.  The application should look in the bin directory version instead of the gac.
Avatar of tjeffryes

ASKER

CorpTech:

Thanks so much for your response.  

Your answer is definitely not the right one, but I think it will definitely lead to what may be wrong here.

As I mentioned, I'm using a commercial hosting account:  Infoquest.  They give me FTP access to my site as well as FrontPage Extensions.  When I created the Visual Studio project, I simply entered http://www-tjs-tools.com/ProExcelDev as the location.  In other words (and this *may* be key) I did not create this on my own machine first.

At any rate, using Visual Studio or my FTP program, in either event I do not see any folder called BIN.  My guess is that it's there somewhere, but because it is a commercial account, either it's in a location that I don't have access to or it's hidden.

I've included 2 screen shots.  One is the view from Visual Studio and the other is from my FTP program.  You can see that there is no BIN.  You will also note various instances of ADODB.DLL appearing. Those are the results of my failed experiments.

Thanks for any additional information.  I think I'm doing one or 2 things terribly wrong.

Sol-Explorer.jpg
FTP.jpg
The solution may still be the same as what I mentioned originally, only not using the bin directory.  Right click on the website solution and go to property pages, remove the current reference to the gac version of the adodb file.  Add a new reference pointing to the adodb.dll file in your website's app_code folder.  You can remove the other copies.  
CorpTech:

thanks for your continued suppor on this.  I'm definitely learning new stuff.  That property pages thing is pretty interesting.

I've attached screen shots of my progress.  I followed your steps but when I add the reference to the file in my app_code folder, it end up showing as being in GAC again and I get the same error.  
Prop-pages1.jpg
empty.jpg
add-ref.jpg
back-in-Gac.jpg
error.jpg
sol-explorer2.jpg
ASKER CERTIFIED SOLUTION
Avatar of corptech
corptech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
CorpTech:

Thanks once again.  Sounds like you're saying that this DLL, adodb, is part of classic ADO?  And that if I use ADO.net, I don't need this reference?   I was not aware of that.

I'll certainly give your idea a try.  I just wanted to answer in advance.  

thanks for the code and refenreces.

I'm just wondering if you could provide me with a screen shot of this "copy Local" thing.  That seems interesting.  Do you suppose it's a version thing?  

Anyway, I'lll try this and get back to you.

I'm very excited.

Tim
Well, I clearly have a long way to go in learnign this stuff, but this was a great start.  Sounds as if I was trying to use classic ADO and you ended up pointing me to ADO.NET, which is where I need to be anyway.  I did a simple test and so far what you gave me seems to work, so that's great.

It would nice nice if I could figure out how you do the "copy local" thing, but other than that I'm very satisfied.

Thanks!
I've attached a sample of an old, old project that I did way back in .Net 1.0.  I had a lot of problems with the data access portions and decided to use classic ADO.  The project in the image has 3 components - website, data layer and reporting layer.  The data layer has the reference to adodb.dll that uses 'copy local' to create a local reference to this file.  When the project is built, it creates the data dll, debug file and copies the adodb.dll into the bin directory.  The main website references the data layer and reporting layer projects and copies these bin files into the main website's bin directory.  This folder and the page source files are uploaded onto the production server.  The source code pages (cs or vb) remain on the production server.  These files are rolled up into the project's dll when it is built.
sample.jpg
I meant - source remains on development server.
CorpTech:

thanks for being so thorough on this.  It's very educational.  This reminds me why I've taken 10 years to get my butt into gear to learn .NET, though.  VB and VBA were so much simpler.  The paradigm shift was/is just too much for me.

What version of VS are you running?  I think I'm in VS 2005, but it may be Visual Studio 2005 Express Edition.  that may account for the lack of the "Copy Local" property.

Thanks again.  I appreciate. it.
I have VS 2005 professional