private void mnuSaveMappings_Click(object sender, EventArgs e)
{
if (saveFileName == "")
{
saveDLG.Title = "Select the Location and File for Mappings";
DialogResult theAns = saveDLG.ShowDialog();
if (theAns == DialogResult.OK)
{
FileInfo theFile = new FileInfo(saveDLG.FileName);
try
{
if (theFile.Exists) { theFile.Delete(); }
}
catch (Exception ex)
{
MessageBox.Show("The File cannot be deleted... it is in use!", "Error Deleting File", MessageBoxButtons.OK);
return;
}
// Create the Access Database
if (MiscProcs.CreateAccessDatabase(saveDLG.FileName))
{
// create the class object for mappings manipulation
theInst = new msAccProcs(saveDLG.FileName);
if (theInst.isConnected)
{
// store the file name for future use
saveFileName = saveDLG.FileName;
}
}
}
}
}