Helpful Information
 
 
Category: ASP.NET
Custom Classes and Ole DB connections

Good Morning Everyone,

I developed a web application on my home computer and it runs fine on the virtual directory. It consists of .aspx web pages that use a custom class called clsDataAccess to interact with an Access database. I uploaded the entire contents of the folder on my home computer to a web server. When I input the url for the website into my browser the index page loads just fine. But when I click a link to go to another page that uses a custom class to access an Access database to fill drop down menus I get an error. On the surface it looks like an Ole DB error. This is the connection string I am using. Dim strConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
HttpContext.Current.Server.MapPath("Database/PatternNumbers.mdb"). Everything I have read says this should work, but I am getting this error.

Server Error in '/' Application.

An OLE DB Provider was not specified in the ConnectionString. An example would be,
'Provider=SQLOLEDB;'. Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: An OLE DB Provider was not
specified in the ConnectionString. An example would
be, 'Provider=SQLOLEDB;'.]

System.Data.OleDb.OleDbConnectionString.ValidateParse()
+762
System.Data.Common.DBConnectionString..ctor(String
connectionString, UdlSupport checkForUdl) +144

System.Data.OleDb.OleDbConnectionString.ParseString(String
connectionString) +96

System.Data.OleDb.OleDbConnection.set_ConnectionString(String
value) +11
GlassPatterns.clsDataAccess.GetConnection() in
C:\Inetpub\wwwroot\GlassPatterns\clsDataAccess.vb:30
GlassPatterns.clsDataAccess.GetAutoMaker() in
C:\Inetpub\wwwroot\GlassPatterns\clsDataAccess.vb:230
GlassPatterns.frmPartLookUp.Page_Load(Object
sender, EventArgs e) in
C:\Inetpub\wwwroot\GlassPatterns\frmPartLookUp.aspx.vb:58
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +744

It almost seams like it is not even getting to the connection string because it is looking for
clsDataAccess on C:\ drive. Do I need to use the web.config file to map the location of custom classes before using them? They are currently in the same folder as the home page named index.aspx.

Tony

hmm i was wondering why no1 posted in the asp.net section.. its all still being posted in here :rolleyes:

Can you post your entire connection code for us to take a look at?










privacy (GDPR)