spectrasoft
05-05-2008, 04:44 AM
Dear friends,
I would like to connect my desktop software with My website MsAccess database to sync online and offline data.
I am developing desktop apps using VB.net2005.
But i don't know what connection string and Datasource to use to connect my website database.
1.whether the connection string and datasource is different for every hosting company. or i can conncet jusst using datasource= "http:\\domainname\database\aaa.mdb"
please help me in this regard.
regards,
bizcredit
05-07-2008, 12:13 AM
I do not think its possible to connect remote access database from your desktop. You should use either mysql or mssql
Burhan
05-07-2008, 04:19 AM
You can mount the remote location as a share in Windows, then you use that share location as the data source for your connect string.
Other than that, there is no way to do it without going to a database.
spectrasoft
05-07-2008, 03:56 PM
i have srver IP and full access to server using remote desktop connection.
i could'nt able to figure out what should be datassource for the connection string.
con = New OleDbConnection("provider=microsoft jet 4.0 ole db provider ;data source=IP Address\D:\.........\aaa.mdb;")
i tried this but no success. Any way to connect to website database.
regards.
Geetha
05-08-2008, 12:18 PM
To map a server to your local machine "File and print sharing" (in TCP/IP) option should be enabled in your remote server, then only you can able to map it.
If that is enabled in the server then this is the procedure to connect
1) Map a drive letter to the server (eg. E,F,G....)
2) Connection string will be (If server is mappaed to E drive)
OLEDB
------
using System.Data.OleDb;
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=E:\mypath\myDb.mdb;" +
"User id=admin;" +
"Password=";
conn.Open();
ODBC
----
using System.Data.Odbc;
OdbcConnection conn = new OdbcConnection();
conn.ConnectionString =
"Driver={Microsoft Access Driver (*.mdb)};" +
"Dbq=E:\myPath\myDb.mdb;" +
"Uid=Admin;Pwd=;";
conn.Open();
But my advise is to create a DSN from your local machine to your remote server and connect the database or else if you have any control panels to manage your site then you can create DSN by yourself or else ask you hosters to create it in the server and provide the name to you. In that case connection string will be like this
using System.Data.Odbc;
OdbcConnection conn = new OdbcConnection();
conn.ConnectionString = "Dsn=DsnName";
conn.Open();