-1

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

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

Votes + Comments
Please use [code] tags.
3
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by khaled_jawaher
0

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

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

let me know the output!

0

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

0

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

Edited by dnanetwork: n/a

0

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>
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.