473,394 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Access database password removed after compacting - why???

Hi all

The below code is compacting a database that has a password. Unfortunately
once the below code is complete the database does not have a password anymore.
How do I have it so the password remains or re-create the password on the
compacted database?? For example say the password on this database is :
'abcdef'. Thanks in advance.

public void compactAccessDB(string targetPath, string strTargetPath )
{
string destConnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source = " +
"FileTmp.mdb";

if( System.IO.File.Exists("FileTmp.mdb") )
System.IO.File.Delete("FileTmp.mdb");

JRO.JetEngineClass objJet = new JRO.JetEngineClass();
objJet.CompactDatabase(strTargetPath, destConnection);

System.IO.File.Delete(targetPath);
System.IO.File.Move("FileTmp.mdb", targetPath);
} //End of compactAccessDB.

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200511/1
Nov 25 '05 #1
0 1157

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Peter Verhelst | last post by:
Hello, Currently I am running an Access database on a windows WTS server, running Microsoft Windows 2000 server 5.00.2195 Service Pack 3. This database should be accessible for everybody in our...
5
by: lappy | last post by:
Hello, I have written a small programme to compact an access 97 database. Dim je As New JRO.JetEngine ' Compacts database Data.Mdb to Data2.mdb. je.CompactDatabase...
6
by: latosca68 | last post by:
I need to demostrate, in a forensic job, that I can change (insert, update, delete) records in a table of an access database without trace. How can I do this ? I plan to make the queries or export...
6
by: owengoodhew | last post by:
Hi, I am responsible for maintaining an MS Access 97 Database that reliably becomes corrupt following a compact......... About the Database: The database is made up of three linked databases,...
5
by: Nathan | last post by:
Hello, I've been using the interop.jro.dll to compact the Access database my aplication uses. After setting a password for the database and changing my oledb connection settings to include that...
5
by: MightyAC | last post by:
Corrupt data in an access database seems to occur far too often. What's worse is that compacting an access 2000 or later db with corrupt data can result in the destruction of relationships. It...
4
by: lamkelf | last post by:
Hi all, I have found solution for previous Access versions (i.e. compacting database) but it doesn't work with the 2003 version. Can someone point me to a website or give me some hints. ...
4
by: corey11 | last post by:
I'm a very low-level developer with limited VB knowledge but nonetheless was able to put together a very user-friendly and extremely helpful Access 97 database for my company some 10 years back. We...
1
debasisdas
by: debasisdas | last post by:
This is a sample code for taking backup and restore of access database Dim DBTempSource As Database Dim DBTempDestination As Database Dim RecTempSource As Recordset Dim RecTempDestination...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.