Want to access access database located in remote location

Posted by Dipu710646 under C# on 2/8/2011 | Points: 10 | Views : 5029 | Status : [Member] | Replies : 10
Hi All,

I have my access database in some remote machine.

I want to access the database from my application.

What is the connection string for that :

I tried as below :

"Provider=MS Remote;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=10.1.5.216\\Shared Files\\WCFService\\admin.mdb";
but when I am trying the fill dataset it is giving following error:

RDS Server Error: The server has denied access to the default RDS handler .....so on..

How will I solve this problem..?

Very urgent..

Any reply is appreciated.

Thanks,
Dipankar




Responses

Posted by: Naimishforu on: 2/8/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
RDS is not supported.

RDS is an old technology that has been deprecated by MS.

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/8/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
You may try below solution:

http://support.microsoft.com/kb/243245

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/8/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Try this below code...

dim conn
dim strconn

strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & _
Server.MapPath("/fpdb/users.mdb")

set conn = server.createobject("adodb.connection")
conn.open strconn

'Create the recordset object
set rs = server.createobject("adodb.recordset")
rs.open "my_users", conn, 2, 2

'set RDS properties for control just created
RDS.Server = "http://<%=Request.ServerVariables("SERVER_NAME")%>"
RDS.Connect = conn
RDS.SQL = "Select * from my_users"
RDS.Refresh


Thanks
Karthik
www.f5Debug.net

Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dipu710646 on: 2/8/2011 [Member] Starter | Points: 25

Up
0
Down
Thanks for your reply.

Basically I am using C# and I need to access the mdb file located in a terminal server.

Please give some idea.

Any help is appreciated.

It is urgent.

Thanks,
Dipankar

Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/8/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
in C#.NET :

object conn;

object strconn;
strconn = ("DRIVER=Microsoft Access Driver (*.mdb);DBQ=" + _);
Server.MapPath("/fpdb/users.mdb");
setconn = server.createobject("adodb.connection");
conn.open;
strconn;
// Create the recordset object
setrs = server.createobject("adodb.recordset");
rs.open;
"my_users";
,conn;
,2;
,2;
// set RDS properties for control just created
RDS.Server = "http://<%=Request.ServerVariables(";
SERVER_NAME;
")%>";
RDS.Connect = conn;
RDS.SQL = "Select * from my_users";
RDS.Refresh;


Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dipu710646 on: 2/8/2011 [Member] Starter | Points: 25

Up
0
Down

Thanks man..

Do I need to add any reference to add RDS..?

Please reply.

Thanks,
Dipankar


Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/8/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
For the complete code into C# try the convertors available online... Just copy my code and paste in the convertor it will give u the C# version

Thanks
Karthik
www.f5Debug.net

Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/8/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Also you need to add the reference... Check this msdn link

http://msdn.microsoft.com/en-us/library/ms678361(v=vs.85).aspx

Thanks
Karthik
www.f5Debug.net

Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/9/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
http://www.developerfusion.com/tools/convert/vb-to-csharp/

Thanks

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Weizz on: 7/25/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Dipankar,
Do you manage to connect to the database located at remote machine? Can you teach me how to connect as I'm currently facing the same problem with you.
Thanks.

Dipu710646, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response