Solved

How to access a function

Posted on 2014-01-29
3
176 Views
Last Modified: 2014-01-29
Hi I have this;

        private void bbComDb_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string AccessConnectionString = Properties.Settings.Default.DBRootConnectionString;
            string File_Path = Application.StartupPath + "DBRoot.mdb";
            CompactJetDatabase(AccessConnectionString, File_Path);
            if (CompactJetDatabase) <===================
                XtraMessageBox.Show("Is goed");
            else
                XtraMessageBox.Show("Is niet goed");


        }

        public static bool CompactJetDatabase(string connectionString, string fileName)
        {
            try
            {
                string oldFileName = fileName;
                string newFileName =Path.Combine(Path.GetDirectoryName(oldFileName),
                Guid.NewGuid().ToString("N") + ".mdb");
                JRO.JetEngine objJet = new JRO.JetEngine();
                objJet.CompactDatabase(oldFileName, newFileName);
                objJet.CompactDatabase(String.Format(connectionString, oldFileName),
                 String.Format(connectionString, newFileName));
                File.Delete(oldFileName);
                File.Move(newFileName, oldFileName);
                return true;
            }
            catch
            {
                return false;
            }
        }

Open in new window


How can I access the function?

Greetings, Peter Kiers
0
Comment
Question by:peterkiers
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Philip Pinnell earned 500 total points
ID: 39817345
try this


 private void bbComDb_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string AccessConnectionString = Properties.Settings.Default.DBRootConnectionString;
            string File_Path = Application.StartupPath + "DBRoot.mdb";
           
            if (CompactJetDatabase(AccessConnectionString, File_Path)) <===================
                XtraMessageBox.Show("Is goed");
            else
                XtraMessageBox.Show("Is niet goed");


        }
0
 
LVL 1

Author Comment

by:peterkiers
ID: 39817356
Thanks. Peter Kiers
0
 
LVL 13

Expert Comment

by:Philip Pinnell
ID: 39817361
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now