[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to access a function

Posted on 2014-01-29
3
Medium Priority
?
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Philip Pinnell earned 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

656 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