Solved

How to access a function

Posted on 2014-01-29
3
173 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
Comment Utility
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
Comment Utility
Thanks. Peter Kiers
0
 
LVL 13

Expert Comment

by:Philip Pinnell
Comment Utility
Thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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