X. J. ZHAN, X. F. LIU
Copyright © 2013 SciRes. ENG
as the absolute pa t h for the database
public void Compact(string mdbPath)
{if (!File.Exists(mdbPath)) // Check if the database a l-
ready exists
{throw new Exception(“The target database does not
exist, can not be compressed”);}
// Enter a name for the temporary database
string temp = DateTime.Now.Year.ToString();
temp += DateTime.Now.Month.ToString();
temp += DateTime.Now.Day.ToString();
temp += DateTime.Now.Hour.ToString();
temp += DateTime.Now.Minute.ToString();
temp += DateTime.Now.Second.ToString() + “.bak”;
temp = mdbPath.Substring(0, mdbPath.LastIndexOf(“\\”)
+ 1) + temp;
// Definite the connection string for the temporary da-
tabase
string temp2 = Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=“ + temp;
// Define the connection string for the target database
string mdbPath2 = “Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=“ mdbPath;
// Instance for Creating a JetEngineClass object
JRO.JetEngineClass jt = new JRO.JetEngineClass();
// Compress and repair the JetEngineClass object da-
tabase using CompactDatabase method
jt.CompactDatabase(mdbPath2, temp2);
// Copy the temporary database to the target database
(overwrit e)
File.Copy(temp, mdbPath, true);
// Final step, delete the temporary database
File.Delete(temp);
public void Backup(string mdb1, string mdb2)
{if(!File.Exists(mdb1))
{throw new Exception(“Source database does not exist
“);}
try
{File.Copy(mdb1, mdb2, true);}
catch (IOException ixp)
{throw new Exception(ixp.ToString());}}
// Restore the database, mdb1 as the absolute path for
the backup database, mdb2 as the absolute path for the
current database
public void Recover(string mdb1, string mdb2)
{if (!File.Exists(mdb1))
{throw new Exception(“Backup database does not ex-
ist “);}
try
{File.Copy(mdb1, mdb2, true);}
catch (IOException ixp)
{throw new Exception(ixp.ToString());}
Click the backup button in the database to activate the
Click event. The database backup can be achieved as
long as it is using an AccessBak method.
5. Conclusion
The system integrates technology advantages of Visual
Studio 2008 and C #.NET development environment to
design and develop an outpatient online appointment
registration system. Since 2010, it has been used as an
experimental teaching program for “Medical Informatics”
and “Hospital Information System” classes for students
majored in computer science with orientation of medical
informatics in our school. It has led to satisf actory teach-
ing accomplishment. Because of the inadequate teaching
equipment, the functionality of online credit card pay-
ment cannot be implemented. We will continue to im-
prove and develop the system with goals of suitable to be
used in small and medium-size hospitals for managing
their outpatient online appointment registration and to be
used for managing outpatient medical records for data
mining.
6. Acknowledgements
This paper is supported by Chinese Medicine Streng-
thened Province Research Project of Guangdong Prov-
ince Administration of Traditional Chinese Medicine,
China (20111232), and Guangdong Province Social De-
velopment Field Technology Project of Guangdong Pro-
vincial Department of Science and Technology, China
(201102).
REFERENCES
[1] H. F. Zhang, “Software Engineering,” Tsinghua Univer-
sity Press, Beijing, 2007, pp. 10-15
[2] Jesse Liberty and Alex Horovitz, “Programming .NET
3.5, O’Reilly Me dia,” Vol. 8, 2008, p. 2.
[3] J. Sharp, “Microsoft Visual C# 2008 Step by Step,” Mi-
crosoft Press, Vol. 12, 2007, p. 2.
[4] S. X. Ca and S. Wang, “Introduction to Database System,”
Higher Education Press, Beijing, 2006, p. 249.