hi all,
i have been trying to take the back-up of a MS Access Database file by using the coding listed below.The Coding
is working well and i am getting a
new mdb file.But while trying to
open the file , it shows some error
( as wrong format file ).Can anybody suggest a solution
for this problem or any other better option for taking
database backup.
Thanx in Advance
Rajesh Nair
Transcriber.java
----------------
import java.io.*;
public class Transcriber
{
public static final
String IN_FILE = "C:\\check\\test.mdb";
public static final String OUT_FILE = "d:\\trials\\copy.mdb";
private BufferedReader br;
private FileReader fr;
private BufferedWriter bw;
private FileWriter fw;
public static void main( String[] args )
{
Transcriber t = new Transcriber();
t.transcribe();
}
private void transcribe()
{
String inLine = null;
String outLine = null;
try
{
fr = new FileReader( IN_FILE );
br = new BufferedReader( fr );
fw = new FileWriter( OUT_FILE );
bw = new BufferedWriter( fw );
while ( ( inLine = br.readLine() ) != null )
{
// This line could be anything, but here
// I just copy the line.
outLine = inLine;
bw.write( outLine, 0, outLine.length() );
bw.newLine();
}
bw.close();
br.close();
}
catch ( FileNotFoundException e )
{
e.printStackTrace();
}
catch ( IOException e )
{
e.printStackTrace();
}
}
}