i am writing an application on my pc to insert record on a microsoft access database on another pc 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 the code below but when i run i am getting the following error:
error on ther server the object model couldnÂșt be found
OleDbException 0x800a2011
the code is :

<%@ LANGUAGE = VBScript Debug="true"  %> 
<%@ Import Namespace="System.Data.OleDb" %>   
<%@ Import Namespace="System.Net.Mail" %> 
<%@ Import Namespace= "System.Web.UI.WebControls.Menu" %>
<%@ Import Namespace="System.Data" %>      
<script Runat="Server" language="VBScript">
public sub button_click(s as object,e as EventArgs)
             dim ssql as string  
             dim strconn,objconn,rs,dbcomm 
             Dim ds As New DataSet
             Dim da As OleDbDataAdapter = New OleDbDataAdapter
             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")  
             objconn.open ()
             dbcomm=New Oledbcommand("employee",objconn)
             dbcomm.commandtext="insert into employee values ('mousa',7,'rome')" 
             dbcomm.Connection = objconn   
             dbcomm.ExecuteNonQuery()
             objconn.close ()
 
end sub
</script>
<html>
<Head>
</HEAD>

<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
<form Runat="Server">
    <asp:textbox id="t1" Runat="Server" text="type"  />
    <asp:button id="b1" Runat="Server" onclick="button_click" text="clickme" />
    
</form>
</BODY>
</HTML>

best regards

kvprajapati commented: Please use [code] tags. -2

Recommended Answers

All 6 Replies

lok i'm not sure about this....

c:\inetpub\wwwroot\db.mdb instead of this try..db.mdb

let me know the output!

i appreciate ur reply
what do you mean by ..db.mdb canu write the complete data source pls
thaNKS

i try it giving the same error

objconn=new oledbconnection("Provider=MS Remote; Remote Server=http://ip address; Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=db.mdb;Persist Security Info=False")

change connection string

Provider=Microsoft.Jet.OLEDB.4.0;Data Source={"remote server shared path of mdb file"};Persist Security Info=False;
also do provide read and write access to remote database file

try this and let me know wot happens...

i am writing an application on my pc to insert record on a microsoft access database on another pc 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 the code below but when i run i am getting the following error:
error on ther server the object model couldnÂșt be found
OleDbException 0x800a2011
the code is :

<%@ LANGUAGE = VBScript Debug="true"  %> 
<%@ Import Namespace="System.Data.OleDb" %>   
<%@ Import Namespace="System.Net.Mail" %> 
<%@ Import Namespace= "System.Web.UI.WebControls.Menu" %>
<%@ Import Namespace="System.Data" %>      
<script Runat="Server" language="VBScript">
public sub button_click(s as object,e as EventArgs)
             dim ssql as string  
             dim strconn,objconn,rs,dbcomm 
             Dim ds As New DataSet
             Dim da As OleDbDataAdapter = New OleDbDataAdapter
             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")  
             objconn.open ()
             dbcomm=New Oledbcommand("employee",objconn)
             dbcomm.commandtext="insert into employee values ('mousa',7,'rome')" 
             dbcomm.Connection = objconn   
             dbcomm.ExecuteNonQuery()
             objconn.close ()
 
end sub
</script>
<html>
<Head>
</HEAD>

<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
<form Runat="Server">
    <asp:textbox id="t1" Runat="Server" text="type"  />
    <asp:button id="b1" Runat="Server" onclick="button_click" text="clickme" />
    
</form>
</BODY>
</HTML>

best regards

ASP.NET Page language must be "VB".

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>

i tried every thing i am getting the same error.i want to know what is the problem.is it in the connection string or where exactly.
error i am getting object can't be found a running time error.
best regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.