0

hi there,
i am still facing the same problem with runtime error object canºt be found when trying to access ms access database remotely.i made the database in the wwwroot folder and give authority read write ,....the code is in the client side i am accessing a server that has static ip address.the code is:

<%@ LANGUAGE = VB 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="VB">
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://196.45.161.123; Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\db.mdb;Persist Security Info=False")  
             objconn.open ()
             dbcomm=New Oledbcommand("employee",objconn)
             dbcomm.commandtext="insert into employee values ('mostafa',7,'tanzania')" 
             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>

ANY IDEAS

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by khaled_jawaher
0

http://www.dbforums.com/microsoft-access/1606990-accessing-ms-access-database-remotely-asp-net.html

read the complete post ..

Try this .... you gave all the access but i dnt think u enabled the sharing..!

Provider="Microsoft.Jet.OLEDB.4.0; Data Source=\\<<IpAddress>>\pos\pos.mdb;"

I have made the folder "pos" as shared and i access it using windows authentication..

Now i'm able to connect to the database and retrieve data. And the reason for having XP instead of 2000/2003 server is, there is only one user accessing the ASP.NET application.

try this and let me know the o/p !

Edited by dnanetwork: n/a

0

thanks for reply
yes,i have put my database in wwwroot directly without putting it in a folder,so no need to share,another thing when i type ipaddress:80/db name i access it normally from another pc.what must i configure in iis and what do you mean by window authentication...
thanx

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.