Hi,

Could you tell me please how can I open a connection to an access database located on a shared folder?

Thanks in advance,

Recommended Answers

All 13 Replies

You can create DSN and use ODBC model in your .net application.

I know how to connect to MS Access database in a local folder, but my problem is that I don't know how to do this if the database is in a shared folder.

I tried to use this connection string in a Windows application but unfortunately it failed:

OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=@\\ServerName\\SharedDocs\\CS\\db1.mdb; Jet OLEDB:System Database=system.mdw;").

When I execute the program, the compiler show me that the database: C:\Documents and Settings\...\@\ServerName\SharedDocs\CS\db1.mdb is not a valid path.

Thanks for your help

Because '\\' means relative path!! not shared path

Can we have access to the shared folder using the OleDb and not the OCDB.

thanks

UNC path, browse it, I developed application runs on db in shared location.

You don't have enough back slashes in there.

If it's a UNC path like this:

\\server\sharename\file.mdb

in C# it would look like:

"\\\\server\\sharename\\file.mdb"

or @"\\server\sharename\file.mdb"

the @ symbol will make it a string literal that doesn't need to be escaped with the extra backslashes.

Hi,

Thank you all for your answers. I tried what "alc6379" recommended me and it works now.

I'm sorry; I didn't answer you before because I didn't receive any message from DaniWeb. No notification messages were sent to me and I don't know why.

HI guys,

i am getting error :
System.Data.Oledb.OleDbExcption : Sybtax error in INSERT INTO sataement.

here a part of my code :

public void Submit()
{
objCommandBuilder = new OleDbCommandBuilder(aAdapter);
// Obtain a new DataRow object from the table Call_Log
insertedRow = table_Call_Log.NewRow();


//CallerComboBox.SelectedItem.ToString();
// Set the DataRow field values as necessary.


insertedRow["Calling_Rep"] = "calling rep";
//insertedRow["Date_of_Call"] = DateTime.Now;


insertedRow["Unnecessary_Call"] = CheckBox1.Checked;


try
{
// Pass that new object into the Add method of the DataTable.
table_Call_Log.Rows.Add(insertedRow);


// Begin send changes to MS Access
aAdapter.UpdateCommand = objCommandBuilder.GetInsertCommand();
//aAdapter.UpdateCommand = objCommandBuilder.GetUpdateCommand();
aAdapter.Update(aDataSet,"Call_Log");


}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}

any suggestions ?
thanks

Can you convert the updatecommand to string? And display it? it should give hints as to why its not working if you can

Hello,

I just started programming in c# a few months ago, i have to do a project that consists in picking up a phone call using my computer, play a .wav file and then detec the key pressed by the user on the telephone pad and according to which number he/she pressed perfom an action ( a typical IVR System). So far i can detect and answer the incoming call, play de wav file, but when i start detecting the DTMF i get an "out of time" error, as if the program is listening but no DTMF is detected...i`m using a wrapper for TAPI3, and the code seems to be fine....i was wondering if it might have something to do with the hardware and if any of you could recomend a modem that supports DTMF detection. Thank you
kondayya (dkondayya1974@gmail.com)

Hello,

OleDbConnection OleCon = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Akarts-ff7f61ed\shareddocs\HSBCDB.mdb;Password=niting;Jet OLEDB:System Database=MySystem.mdw");

I am using this connection string to access database from work group computer.

access verson 2007.


and getting error "Can't start your application. The workgroup information file is missing or opened exclusively by another user"

Hello

I am using this connection string

OleDbConnection OleCon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\\\Akarts-ff7f61ed\\shareddocs\\HSBCDB.mdb;Jet OLEDB:System Database=MySystem.mdw;Password=niting

and getting error "Cannot start your application. The workgroup information file is missing or opened exclusively by another user."

I need to solve it please help

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.