SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .net c# code to connect to MS Access DB in SharePoint

    Hi Frndz,
    I need your help.

    Currently i have written a piece of code which connects to MS Access DB to fetch the data, it works fine in a standalone system.
    I need to place the c# code and MS Access DB in Sharepoint Server and need to fetch the data.
    I tried various Connection Strings methods to establish the connection with MS Access DB, but proved to be fuitle.
    Its inline coding in C#.
    Can you juz help me out of how the connection to a MS Access DB placed in Sharepoint Server.

  2. #2
    SitePoint Member
    Join Date
    Jan 2004
    Location
    St Ives
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What version of Access are you using? What version of SharePoint? Are you trying to syncronize an Access database with a SharePoint list? More information about the problem you are trying to solve will help.

  3. #3
    SitePoint Enthusiast ked38's Avatar
    Join Date
    Aug 2010
    Location
    www
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe a little help, a c# sample connect part:


    <!--MS ACCESS sample connection string-->
    <add name="YourConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|YourDataPath/Dir|accessdata.mdb;Jet OLEDBatabase Password=DB_PASSWORD;" providerName="System.Data.OleDb"/>


    Edit: there is a bug for script's: [: D] (display a grin), below code are updated, remove the extra space.

    <!--MS ACCESS sample connection string-->
    <add name="YourConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|YourDataPath/Dir|accessdata.mdb;Jet OLEDB: Database Password=DB_PASSWORD;" providerName="System.Data.OleDb"/>




    For reference only.
    Ked

  4. #4
    Non-Member
    Join Date
    Sep 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Dear
    Before going for connection you should first of all create the DSN name and it is must. For creating the DSN Name go to control panel-Administrative tool- ODBC connectivity-Add- and finally put the DSN Name. You can choose User DSN or System DSN any of them. If u are using on same machine then choose User DSN if u are using different machine then choose System DSN.
    Now put your DSN Name in place of Connection string


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •