An OLE DB Provider was not specified in the ConnectionString

  • Thread starter Thread starter Joe Newlin
  • Start date Start date
J

Joe Newlin

I am getting an error: Server Error in '/' Application. An Ole Db
Provider was not specified in the ConnectionString. An example would
be, 'Provider=SQLOLEDB.
My Function is this: Public Function GetDataSource(ByBal sql As String)
As DataView
Dim ds as DataSet
Dim cnn as OleDbConnection
Dim cmd As OleDbDataAdapter
Cnn = New OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=e:\Book.mdb")
Cnn.Open()
Cmd = New OleDbDataAdapter(sql, cnn)

I Get this error even if I comment out the entire function.
 
If the entire function is commented out, and you are still getting the
error, that means the source of the error is not this function. Look at the
rest of your code to see where you are trying to open a connection.
 
Can you look at the stack trace of the exception. It might be that you are
opening the connection in a different module.
HTH,
Sushil.
 
¤ I am getting an error: Server Error in '/' Application. An Ole Db
¤ Provider was not specified in the ConnectionString. An example would
¤ be, 'Provider=SQLOLEDB.
¤ My Function is this: Public Function GetDataSource(ByBal sql As String)
¤ As DataView
¤ Dim ds as DataSet
¤ Dim cnn as OleDbConnection
¤ Dim cmd As OleDbDataAdapter
¤ Cnn = New OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;Data
¤ Source=e:\Book.mdb")
¤ Cnn.Open()
¤ Cmd = New OleDbDataAdapter(sql, cnn)
¤
¤ I Get this error even if I comment out the entire function.

On which line of code does the exception occur?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
This is my
Stack Trace:


[ArgumentException: An OLE DB Provider was not specified in the
ConnectionString. An example would be, 'Provider=SQLOLEDB;'.]
System.Data.OleDb.OleDbConnectionString.ValidateParse() +767
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +144
System.Data.OleDb.OleDbConnectionString.ParseString(String
connectionString) +98
System.Data.OleDb.OleDbConnection.set_ConnectionString(String value)
+11
System.Data.OleDb.OleDbConnection..ctor(String connectionString) +158
www.joenewlin.com.Guest.GetDataSource(String sql) in
\\xxxxweb\joenewlinxxxx\book.vb:75
www.joexxxx.com.book.BindGrid() in
\\xxxxxweb\joenewlinxxxx\book.aspx.vb:85
www.joexxxx.com.book.Page_Load(Object sender, EventArgs e) in
\\xxxxxweb\joenewlinxxxx\book.aspx.vb:73
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
 
Are you recompiling your code before you re-run your project?

If the entire function was commented out, there is no possible way you could
get an exception coming from inside it.

Joe Newlin said:
This is my
Stack Trace:


[ArgumentException: An OLE DB Provider was not specified in the
ConnectionString. An example would be, 'Provider=SQLOLEDB;'.]
System.Data.OleDb.OleDbConnectionString.ValidateParse() +767
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +144
System.Data.OleDb.OleDbConnectionString.ParseString(String
connectionString) +98
System.Data.OleDb.OleDbConnection.set_ConnectionString(String value) +11
System.Data.OleDb.OleDbConnection..ctor(String connectionString) +158
www.joenewlin.com.Guest.GetDataSource(String sql) in
\\xxxxweb\joenewlinxxxx\book.vb:75
www.joexxxx.com.book.BindGrid() in
\\xxxxxweb\joenewlinxxxx\book.aspx.vb:85
www.joexxxx.com.book.Page_Load(Object sender, EventArgs e) in
\\xxxxxweb\joenewlinxxxx\book.aspx.vb:73
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750



On Wed, 20 Jul 2005 15:00:11 +0000, "Joe Newlin"

¤ I am getting an error: Server Error in '/' Application. An Ole Db
¤ Provider was not specified in the ConnectionString. An example would
¤ be, 'Provider=SQLOLEDB.
¤ My Function is this: Public Function GetDataSource(ByBal sql As
String)
¤ As DataView
¤ Dim ds as DataSet
¤ Dim cnn as OleDbConnection
¤ Dim cmd As OleDbDataAdapter
¤ Cnn = New OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;Data
¤ Source=e:\Book.mdb")
¤ Cnn.Open()
¤ Cmd = New OleDbDataAdapter(sql, cnn)
¤
¤ I Get this error even if I comment out the entire function.

On which line of code does the exception occur?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Apparently I have bigger problems, after playing around with this some I
have found that when commenting out code or even delete out entire
functions or even commands the web site continues to function as if
changes have not be made. I have check to make sure that changes have
been saved to the server and have deleted all cache on the client, web
server and proxy server. I appreciate every ones attempt to help with
this but it looks like a problem with a different subject.


Are you recompiling your code before you re-run your project?

If the entire function was commented out, there is no possible way you could
get an exception coming from inside it.

This is my
Stack Trace:


[ArgumentException: An OLE DB Provider was not specified in the
ConnectionString. An example would be, 'Provider=SQLOLEDB;'.]
System.Data.OleDb.OleDbConnectionString.ValidateParse() +767
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +144
System.Data.OleDb.OleDbConnectionString.ParseString(String
connectionString) +98
System.Data.OleDb.OleDbConnection.set_ConnectionString(String value) +11
System.Data.OleDb.OleDbConnection..ctor(String connectionString) +158
www.joenewlin.com.Guest.GetDataSource(String sql) in
\\xxxxweb\joenewlinxxxx\book.vb:75
www.joexxxx.com.book.BindGrid() in
\\xxxxxweb\joenewlinxxxx\book.aspx.vb:85
www.joexxxx.com.book.Page_Load(Object sender, EventArgs e) in
\\xxxxxweb\joenewlinxxxx\book.aspx.vb:73
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750



On Wed, 20 Jul 2005 15:00:11 +0000, "Joe Newlin"

¤ I am getting an error: Server Error in '/' Application. An Ole Db
¤ Provider was not specified in the ConnectionString. An example would
¤ be, 'Provider=SQLOLEDB.
¤ My Function is this: Public Function GetDataSource(ByBal sql As
String)
¤ As DataView
¤ Dim ds as DataSet
¤ Dim cnn as OleDbConnection
¤ Dim cmd As OleDbDataAdapter
¤ Cnn = New OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;Data
¤ Source=e:\Book.mdb")
¤ Cnn.Open()
¤ Cmd = New OleDbDataAdapter(sql, cnn)
¤
¤ I Get this error even if I comment out the entire function.

On which line of code does the exception occur?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top