locked
pls help me in accessing ms access remotely can any one try my code?? RRS feed

  • Question

  • User-1196439174 posted

    i am writing an application on my pc considered as client, to insert record on a microsoft access database on another pc that u can consider it as server, that has static ip address remotely.i can ping the remote address of the pc that i want to access without problems.the access database is in the folder c:\inetpub\wwwroot\db.mdb.
    i have shared the folder and give it premission read write etc.....
    i have the code below but when i run i am getting the following error:
    error on the server: the object model couldnºt be found
    OleDbException 0x800a2011

    pls can any one try it and give me the solution.i mean also the steps,bcs i tried evey thing and i am fed up.
    the code is :

    ASP.NET Syntax (Toggle Plain Text)
    1. <%@ LANGUAGE = VBScript Debug="true" %>
    2. <%@ Import Namespace="System.Data.OleDb" %>
    3. <%@ Import Namespace="System.Net.Mail" %>
    4. <%@ Import Namespace= "System.Web.UI.WebControls.Menu" %>
    5. <%@ Import Namespace="System.Data" %>
    6. <script Runat="Server" language="VBScript">
    7. public sub button_click(s as object,e as EventArgs)
    8. dim ssql as string
    9. dim strconn,objconn,rs,dbcomm
    10. Dim ds As New DataSet
    11. Dim da As OleDbDataAdapter = New OleDbDataAdapter
    12. objconn=new oledbconnection("Provider=MS Remote; Remote Server=http://ip address; Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\inetpub\wwwroot\db.mdb;Persist Security Info=False")
    13. objconn.open ()
    14. dbcomm=New Oledbcommand("employee",objconn)
    15. dbcomm.commandtext="insert into employee values ('mousa',7,'rome')"
    16. dbcomm.Connection = objconn
    17. dbcomm.ExecuteNonQuery()
    18. objconn.close ()
    19.  
    20. end sub
    21. </script>
    22. <html>
    23. <Head>
    24. </HEAD>
    25.  
    26. <BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
    27. <form Runat="Server">
    28. <asp:textbox id="t1" Runat="Server" text="type" />
    29. <asp:button id="b1" Runat="Server" onclick="button_click" text="clickme" />
    30.  
    31. </form>
    32. </BODY>
    33. </HTML>
    pls help me


    best regards

    <!-- google_ad_section_end -->

    ibest regards

    <!-- google_ad_section_end -->
    Wednesday, July 21, 2010 7:50 AM

Answers

  • User-1199946673 posted

    a more popular and available database.as excel
     

    Excel, a database? I don't think so.

    Both Excel and Access are filebased 'databases'. When accessing them on remote servers you need the permissions, go throufh firewalls etc. which will cause all kind of (security) problems, and performance will certainly not  be very good if you succeed. But what is the problem in using SQL Server Express, which is free also and much more scalable and secure?

    http://www.microsoft.com/express/Database/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 21, 2010 4:28 PM

All replies

  • User1710623990 posted

    Try impersonate in web config file

    <configuration>
    <system.web>
    ...
    <identity impersonate="true" />
    ...
    </system.web>
    </configuration>

    Hope that helps Cool


    Wednesday, July 21, 2010 8:13 AM
  • User-1196439174 posted

    i appreciate ur response.

    non sense,i try it

    it is giving me the same runtime error.hope u can try the code my freind.

    i've post my question many times till now no response.

    do you think the problem is from the database itself,so if i change to sql,would it work?

    and if so i want to know why they create oledb 4.0 to MSACCESS?isn't  for using it?

    Wednesday, July 21, 2010 8:41 AM
  • User-1199946673 posted

    Accesing Access database on remote computers will cause all kinds of permissions problems, it's very hard if not impossible to guide you in the right direction. In this scenario, I would advice to use SQL Server Express Edition...

    Wednesday, July 21, 2010 3:29 PM
  • User-1196439174 posted

    thanx for response

    i want to know why the create oledb 4.0 remote provider,isn't for using with accessing ms access remotely?

    if difficult,i want to use a more popular and available database.as excel,..

    is it possible? 

    Wednesday, July 21, 2010 4:17 PM
  • User-1199946673 posted

    a more popular and available database.as excel
     

    Excel, a database? I don't think so.

    Both Excel and Access are filebased 'databases'. When accessing them on remote servers you need the permissions, go throufh firewalls etc. which will cause all kind of (security) problems, and performance will certainly not  be very good if you succeed. But what is the problem in using SQL Server Express, which is free also and much more scalable and secure?

    http://www.microsoft.com/express/Database/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 21, 2010 4:28 PM