Solved

Conversion from Access2000 to C++

Posted on 2000-05-09
10
183 Views
Last Modified: 2012-05-04
I have a problem solving algorithm I have developed in Access2000/VBA6.  The algorithm works great.  My question regards the efficiency increase my algorithm would receive if I re-wrote it in C++, VB and what development time I can expect.  

If access 2000 takes 1 hour to run the algorithm approximately how long can I expect it to take if I re-write it in:
A) C++
B) VB6

If it took me 100 hours to develop my algroithm (including interface) using Access 2000, approximately how long can I expect to develop in:
(I have no experience developing applications in C, 2 years in Access and VB)
A) C++
B) VB6

Thanks,

Billy
0
Comment
Question by:billy21
[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
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 14

Expert Comment

by:wsh2
ID: 2795480
You have to tell us more about your algorithm.. does it use recursion.. matrices.. and/or large amounts of memory? Do portions of it require linked lists.. table value insertions and deletions.. integer values or just plain old work the math co-processor work?

As far as writing the code.. with your background.. Visual Basic would be the natural choice.. as much of the syntax and commands you already know. Coding in C/C++ is VERY different than what you are accustomed to syntax wise.

Additionally, C/C++ coding in many instances is at a much lower level. What you can do in a couple of VB lines.. may take you twice as many in C/C++.. but keep in mind, when you do it the C/C++ way.. you can do it in an extremely efficient manner.. without extra machine instructions that a high level compiler (VB) may add in for superfulous features unneccesary to your particular application. C/C++ executables (programs) are much smaller than VBs, and can be deployed / run on client machines without having to install several megs worth of additional runtime libraries that are essential to VB to run in the first place.

From a brand new development standpoint.. hands down.. C/C++ takes longer. But in using C/C++ well, the end product is very often much tighter and efficient.. and in that you can very often garner substantial performance gains. However, as your library of C/C++ routines grow.. this development time will shrink to that of doing it in Visual Basic.

Through ActiveX Components (Controls, DLLs and EXEs) both languages can communicate with each other fairly easily. As such parts of your algorithm could be written with C/C++ efficiency and another part could be written with  Visual basic simplicity. As far as communicating with the Operating System, Visual Basic has come a LONG way, but still has a way to go when it comes to matching C/C++ for linking into Windows Operating System API calls. (Note: Windows itself is primarily written in C/C++ as is Linux and Unix.. with parts of it (mostly hardware interfaces) written in Assembler).

When it comes to Internet programming.. there is Java and VBScript. Java very much resembles C/C++ and VBScript it's Visual Basic counterpart. Both Java and C/C++ are universally supported on all Operating System platforms.. while VbScript and VB will only run on a Microsoft platform. However, neither language is used on an IBM Mainframe.. so in that regard.. they are equal. Even though VB is NOT universal, MicroSoft has fully endorsed it as a continuing core product of their Office suite of Applications, MSIE scripting,  and COM/DCOM processing structure. For all intensive purposes VB is here to stay.

Anyhow.. now that you have fallen asleep from reading all this <yawn>.. if I were you.. in your position.. I would definitely opt to go with Visual Basic. Your learning curve is going to be considerably shorter.. the principles / vocabulary that you learn with VB will often be applicable in your endeavor to master C/C++.. and finally, I believe you should master one language before embarking into another.. and with your 2 years of VBA experience you are already a good part of the way there.. <smile>
0
 
LVL 6

Author Comment

by:billy21
ID: 2795614
The algorithm produces every possible combination of numbers and uses it to create a boolean matrix. It Can loop up to 75 thousand times and run for up to 1.5 hours depending on the user inputed criteria.  A large array of successful combinations are stored as matrices in a string variable with delimiters separating each matrix (ie: --xxxx----,---xxxxx---,...)

Billy
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2795647
I think, best way for you stay in VBA,
but computable part (that works 75000 times), make on C++/assembler(assembler
in 2 more fast, that C/C++ and in 10 times as VB). For using this you can or
make ActiveX control or (more simple )
some DLL. Of course, you know how use some DLL from VBA. Make DLL it was more
complicated, but now with last versions of VC/BC  it is very easy, there are
many books/articles about this theme and you can find many examples in MSDN.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:pjknibbs
ID: 2795743
billy21: First of all I'd look at the algorithm. Is it as efficient as it could be? If it takes an hour and a half to perform 75000 loops, I'd say probably not. It would be better to optimise the algorithm in VB than rewrite it in a different language.

I'd also ask: since this algorithm uses Access 2000, is it the algorithm that's slow or the database access that's slow? If you're performing a database access operation on every one of those loops that's probably where the slowdown lies, and rewriting in C will give you virtually no benefit.
0
 
LVL 6

Author Comment

by:billy21
ID: 2795790
pjknibbs,

It takes up to 1.5 hours because of the tasks carried out on successful combinations.  Tests are run to see whether or not a combindation fits the parameters required then if it does some extra code is run.  It isn't run on all of the 75K.  The  number of successful combinations depends entirely on the parameters set by the user.

What I really need from everybody is an educated guess.  I'm not going to be upset if you tell me it will run in 15 mins and it actually takes 25 mins.  There are no database operations in this code.  The user enters a whole lot of numbers on screen,  it uses the numbers to come up with a boolean matrix.  It scores each matrix and displays the top ten on screen for the user.  I only wrote it in VBA because development time was more important than efficiency.  Now efficiency is more important than development time.

How much more efficiently will it run?
How much time will I have to set aside for development?
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 50 total points
ID: 2796293
As i wrote , coefficient VB->C ~ 5 (depends from operations).
If you VBA time ~ 1.5 hour, same code
in C/C++ must work(i hope) ~ 18min.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2796508
Billy21 writes:
"How much more efficiently will it run?
How much time will I have to set aside for development?"

The two questions are very closely related. To eke out performance gains from C/C++ takes quite a bit of experience and technique. The longer you work with and study C/C++ the more efficient and tight your code will become. In my experience it takes two years (full time) to Master a language.. and during that time.. in the process of learning you really do cut some crappy executing code out.. <guilty look>. At least with VB, you have a jump on this. I suppose the real question is - how much time do you have to spend to develop this and what are your educational resources?

I like to add one other thing.. over the last 10 years there has been a huge increase in processor power and memory speeds.. with a huge decrease in cost. The chicken and egg question always has been "Did Intel (Hardware) make MicroSoft (Software).. or was it the other way around?" Millions of expensive programming hours were spent optimizing code to run efficiently on 4.77mhz PCs.. then 12mhz.. 16mhz.. 25mhz.. etc.. etc.. that if you go to execute now, run in a blink of an eye. Microsoft was always known for writing big, sloppy, slow code.. but Intel (Cyrus or AMD) always had a hardware solution around the corner and when it came out Microsoft was there with code that worked. Now.. who made all the money.. Intel (hardware) or Microsoft (software)?

My recommendation to you is still..  get your program done in the most expedient manner.. and then worry about the efficiences later. Keep in mind, the whole time you are doing this.. the processor people are working on your side.. to make it run in a blink of the eye. As you already have considerable experience in VBA, I would suggest you Master your skills there before moving to a whole new programming language.
0
 
LVL 6

Author Comment

by:billy21
ID: 2802446
Would there be a huge difference If I were to write in Visual C++6 than straight C++?
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2803202
What do you meens
>>straight C++
VC , as i know, works slow , but make
exellent exe code, that works (~) only 1.5 time worst as Assembler.

0
 
LVL 6

Author Comment

by:billy21
ID: 2808982
Thank you for your assistance.

Billy
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Issues with C++ Class 19 116
Embarcadero C++ builder XE10.1 Berlin TRegistry declaration 1 57
Gaming Software 1 37
Coding for the first time 9 95
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

739 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