Ms-Access 2007 could not find my access database

hi,

i trying to export datagrid to excel and for that i created database using Ms Access 2007 and when i tried to connect to my database its not connecting instead it is throwing an error

"Could not find file 'D:\Application\Test\Excel.mdb"

My connection is

OleDbConnection cn = new OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0;Data Source=Excel.mdb;");

could any one help me out why i m not able to connect it ... 

 


Thanks & Regards,
Ramesh.S,
Software Engineer,
http://www.rameshsengamalai.info
0
rameshsengamalai
4/25/2009 12:26:20 PM
asp.net.access-datasource 4679 articles. 0 followers. Follow

3 Replies
842 Views

Similar Articles

[PageSpeed] 7

 you code will be


 

OleDbConnection cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Application\Test\Excel.mdb;User Id=admin;Password=;");

if you use app_data folder then code will be

OleDbConnection cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Excel.mdb;User Id=admin;Password=;");
 

so its depends on you , which one you want to use .

Have a nice programming

Md. Parves Kawser


Please remember to click,
remember to click

"Mark As Answer"

on the post that helps you.
0
rezakawser
4/25/2009 5:07:42 PM

 oh i am sorry cause i thought you are using Access 2003

for Ms Access 2007 you have to use this connection string 

 

OleDbConnection cn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Application\Test\Excel.mdb;User Id=admin;Password=;");

if you use app_data folder then code will be

OleDbConnection cn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\myDatabase.mdb;User Id=admin;Password=;");
 

so use anyone

Have a nice programming

Md. Parves Kawser


Please remember to click,
remember to click

"Mark As Answer"

on the post that helps you.
0
rezakawser
4/25/2009 5:11:00 PM

Oh ... Thanks this what i m expecting ....


Thanks & Regards,
Ramesh.S,
Software Engineer,
http://www.rameshsengamalai.info
0
rameshsengamalai
4/26/2009 7:37:44 AM
Reply:

Similar Artilces:

accessing MS Access from .net
hi I am accessing ms access data base which has a table called customers. when i try to insert data into the table i am gettign the error like "Operation must use an updatable query" and the line its showing is myOleDbcommand.ExecuteNonQuery() here is my code in page lode event Sub Page_Load(Sender As Object, E As EventArgs) Dim StrConnectString as String Dim strStatement as String strConnectSTring = "Provider=Microsoft.Jet.OLEDB.4.0;Password='';User ID=Admin;Data Source=C:\Inetpub\wwwroot\Srinu\WebApplication2\...

Accessing a MS Access database
Hi, I would like to do a lookup into an Access database, and display the result in a grid. I'm an embedded programmer being thrown into the world of .net, asp, VB, and databases so I don't know where to start :-) ...... can anyone help me ? Thanks. Really jus ta matter of making a connection, doing your query, and displaying results. Here is a sample from a module I use. The data is bound to a datagrid. Sub LoadSchedule() Dim strSrc As String = CType(Settings("src"), String) If Trim(strSrc) <> "" Then ...

Access access
========== Hi, Everyone ... I'm going to lock this thread for now. If you have a question about working with Access in Web Matrix, please start a new thread in this forum. Otherwise, this thread will get to be unwieldy. Thanks! ========== Updated 6/29/03 Hello, everyone. I've been working with the new version of Web Matrix (version .6, build 812, available right now!). In particular, I've been playing with support for Microsoft Access, which is one of the great new features in the new release. I wrote up some notes on what I've found to share some of my experiences and to a...

accessing access
------=_NextPart_000_029B_01C29063.1E2098D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi! I am trying to access an access mdb file for the first time. I get the following error: Can't connect(dbi::ODBC:pfawtbls.mdb ), no database driver specified and DBI_DSN env var not set at jfa_data.pl line 147 for the code: my $dbh = DBI->connect( "dbi::ODBC:pfawtbls.mdb", "", "", ) or die "Unable to connect: ". $DBI::errstr. "<br>"; What am I missing? Thanks, Jer...

Accessing MS Access
Hi all, This is probably a more DB oriented question, but it came out of the = DBI. I posted a question and have tried several solutions on how to open = up an MS Access DB from the DBI::ODBC but so far have been unable to. = What I had to end up doing was create a DTS that runs every 5 minutes = which copies the table I need from Access and populates a SQL Server = table. This causes a delay on my web application such that whenever my = page overlaps while the DTS is running I get no data. So I was wondering = if there is a better way to get information from Access so I can see it =...

accessing ACCESS database
Hi, I am trying to write a script that copies an information from ACCESS but it gives me the following error: Can't call method "Sql" on an undefined value at franowner.pl.txt line 4. Here's the script: use Win32::ODBC; $DSN="db1"; $db = new Win32::ODBC("db1"); $db->Sql("SELECT owner_first_name, owner_last_name FROM Owners WHERE ID=11"); if ($db->Error()) { print "Error: $db->Error"; } statement:\n$DBI:errstr\n"; ($ownerfname,$ownerlname) = $db->FetchRow(); print "Database results: first ...

How to Access a MS Access Database in a webserver
i, I have a database that is located outside of root. /database /myzone /clients /test /WebAPPTest4/default.aspx I was given following code by my host but I couldnt get it work. ****************************************************** Private Sub Connection() Dim strPath = Server.MapPath("/") Dim strPathDatabase = Replace(strPath, "\www", "\database") Dim strConnection = strPathDatabase & "\RecordLabel.mdb" Dim sConnectionString As New String("Provider=Microsof...

Synchronise access to ms access database
Hello guys, i'm currently working on an asp.net application that connects to an access database. What I am noticing in the developement process is that whenever i'm opening the database using MS access and trying to execute a function in my project that needs to access the database, i get an error "couldn't open file". Well, the solution is to close the database in MS access so to be allow my asp.net application to access the database. What i m wondering now is what will happen if two or more users connect to my asp.net application and try to do some operation on the database. w...

How to get an access to MS Access database?
Is it possible to get normal access to MS Access database without OLE DB drivers just with methods of ASP.NET. The problem is that the hoster set trust level to medium and does not allow using of OLE DB drivers. Thank you....

MS access to MS access problem
I always used MS Access Database In my programs, now I want to use SQL SERVER database and so I started to design one. but it’s a little bit confusing ,I don’t know what can I use in change of these access Data type : MS access // MS access -------------- -------------------- Memo >>>>>>>> ?? AutoNumber >>>>> ?? * and if you think there is some difference between Ms access and SQL in D...

How to access the MS access database for different domains.
 I have three domains configured on the same server (one IIS server).and i have three copies of the same Access database for three different domains. i want that only one copy the MS Acess database can share the three domains.  How can i accomplish this task. thanks in advance. zainullah...

Single user access on MS Access database
We just transitioned our DATA volume from a Netware traditional volume to a iSCSI connected NSS volume on a NetApp Filer FAS 270. Netware 6.5 Since the move we've noticed a MS Access database issue arise. When the database is opened by the next user they receice the error message: "MSysAccessObjects can not be opened it is currently opened by another user" This is an Access file table not a custom table. Is it a Oplocks and/or File Caching issue on the server? If so, where can I tuen that off? Does anyone know of any issues regarding MS Access and NSS volu...

Accessing Sybase Database with MS Access 97
I'm trying to use Microsoft Access 97 to access a Sybase SQL Anywhere database. I can link to 95% of the tables, but I'm not allowed to link or import any of the tables created by "SYS". I need to access SYSTABLE, SYSCOLUMN, SYSDOMAIN, etc. As a matter of fact, not only am I not able to import the tables, I can't even see those tables when I'm presented with a list of tables to choose from in MS Access. Please reply to my e-mail address if possible! Thanks. -- Peter Lucas Decade Software Company peterlucas@mediaone.net Maybe Access is only listing ...

Accessing MS Access Database with security password
Hi, can anyone help me how to access my MS Access database that has a security password? Im using C# btw. ThanksDon't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue. Look at www.connectionstrings.com for examples of all sorts of connection strings.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog Thanks! Its all there.Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue. Hello, I...

Web resources about - Ms-Access 2007 could not find my access database - asp.net.access-datasource

Resources last updated: 1/1/2016 8:18:50 AM