An OLE DB Provider was not specified in the ConnectionString

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.
 
M

Marina

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.
 
S

Sushil Chordia

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.
 
P

Paul Clement

¤ 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)
 
J

Joe Newlin

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
 
M

Marina

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)
 
J

Joe Newlin

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top