Solved

deploy adodb.dll on commercial hosted server

Posted on 2009-07-02
11
996 Views
Last Modified: 2012-05-07
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

0
Comment
Question by:tjeffryes
  • 6
  • 5
11 Comments
 
LVL 2

Expert Comment

by:corptech
ID: 24774887
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.
0
 
LVL 1

Author Comment

by:tjeffryes
ID: 24774992
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
0
 
LVL 2

Expert Comment

by:corptech
ID: 24777241
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.  
0
 
LVL 1

Author Comment

by:tjeffryes
ID: 24777353
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
0
 
LVL 2

Accepted Solution

by:
corptech earned 500 total points
ID: 24777916
I've been able to make reference issue work with the 'copy local' property but I doesn't look like you have that option.  

Are you needing to use classic ADO or would you rather use ADO.NET?  If you don't need the old ADO stuff, you can remove the references and add these to your page code (not source):

System.Data.OleDb
System.Data.SqlClient (or System.Data.OracleClient)

This will give you access to all of the data components you'll need.  
This is a good basic ado.net reference - http://msdn.microsoft.com/en-us/library/aa302325.aspx
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 1

Author Comment

by:tjeffryes
ID: 24777939
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
0
 
LVL 1

Author Closing Comment

by:tjeffryes
ID: 31599418
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!
0
 
LVL 2

Expert Comment

by:corptech
ID: 24780134
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
0
 
LVL 2

Expert Comment

by:corptech
ID: 24780152
I meant - source remains on development server.
0
 
LVL 1

Author Comment

by:tjeffryes
ID: 24783960
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.
0
 
LVL 2

Expert Comment

by:corptech
ID: 24785351
I have VS 2005 professional
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now