none
vb.net beginners - error keyword not supported 'provider' RRS feed

  • Question

  • i try to connect access 2007 database file (temp.accdb) by using vb.net 2010

    error occured keyword not supported 'provider'. 

    con.ConnectionString=

    "provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\AOS\My Documents\temp.accdb;Persist Security

    Info=True"

    Monday, August 13, 2012 6:27 AM

Answers

All replies

  • Hi Ashish,

    Welcome to the MSDN Forum.

    What kind of connection class do you use? SqlConnection

    Anyway, when you try to connect Access Database, please try oledbConnection, here is the cause:http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/77ff9db1-c69d-4a14-b606-d208832b8756/ 

    When you are using a specific provider, you can not specify the Provider (as the provider-specificConnection object is the provider).  Remove the Provider value from your connection string.  If you are using the genericOleDbConnection then you should use the Provider value so ADO.NET knows what provider to instantiate.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, August 14, 2012 2:09 AM
    Moderator
  • Hi, I am also getting this same error when my asp application has been uploaded to my host site. I am using Visual Studio 2010 with MS Access 2010.

    This is my connection string in my web.config file 

     <add name="ConTrakDB" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\inetpub\wwwroot\sj10abs\db\ConTrakDB.accdb;" />

    I use the below connections in aspx files 

                     <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConTrakConnection %>" 
                        ProviderName="<%$ ConnectionStrings:ConTrakConnection.ProviderName %>" 
                        SelectCommand="SELECT DISTINCT [Username] FROM [Timecards]"></asp:SqlDataSource>

    and 

     Dim oledbconn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("ConTrakDB").ConnectionString) in the aspx.vb files. I have looked around at other forums for this error but cant find where I am using a SQLconnection other than the datasources in the aspx files. Could it be this causing the error?

    Many thanks 

    Sheena

    Monday, December 24, 2012 4:47 PM