Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Applications that are oblivious of the type of database (SQL or Access)

Posted on 2010-11-30
6
Medium Priority
?
310 Views
Last Modified: 2012-05-10
Hello Experts,

I need to write four applications in VB.net that are totally oblivious of what database is being uised; SQL or mdb (Access). What is the best approach? Are there any classes, modules or generic functions I can use?

Before you start telling me this is a bad approach, currently these four applications are written in VBA (mde) and using Access (mdb) as a back-end. We want to port the whole thing to VB.net/Ms SQL, but for various reasons it's just not feasible to do this in one big bang. We therefore opted for porting te applications one by one to VB.net, while still using the mdb-backend. Once all applications are ported we switch to SQL and start optimizing the applications for the new databse. This way the porting can be done gradually while minimizing the impact on our customers.

Any pointers, thoughts or suggestions are greatly appreciated.

regards,
Michiel
0
Comment
Question by:altiplano
[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
6 Comments
 
LVL 3

Assisted Solution

by:cnjuguna
cnjuguna earned 400 total points
ID: 34239298
I think creating apps that are not database-specific is actually a desirable quality and recommended.

Use ODBC that way as long as the datasource has the same name, the application does not have to deal with connecting specifications or anything of the sort.

*However*, note that not all SQL commands are available in different DBs. Syntax may also change for some commands depending on what DB you are using. It shouldn't be a problem with simple selects, inserts and updates especially if the DBs are Access and SQL server.
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 400 total points
ID: 34239824
IMO, using unbound controls in VB.NET is the first step. Use a data layer (i.e. a set of classes/modules etc where you interact with the database), and you can then code that data layer to take advantage of the various databases in use.

Note that while Access is _mostly_ ANSI compliant, it's not quite there yet. You may have to work with some IF constructs to properly manage data in an Access databse versus other platforms. For example, Access includes a Boolean datatype, whereas SQL Server does not, so you can just pass True or False to SQL Server, and if you pass 0 and 1 to an Access Boolean field, you'll end up with munged data. Also, Access expects Date values to be wrapped in hash marks ( # ), while other platforms will choke on this. You can use the standard single quote delimiters for this, of course, so just be aware of things of this nature.
0
 
LVL 22

Assisted Solution

by:dportas
dportas earned 400 total points
ID: 34239923
One of the potential problems is that the Jet database designs simply may not be suitable for SQL Server. In the MDB world you could encounter tables with missing keys or tables that are dependent on row order or the use of other aspects of Jet that don't easily translate to the SQL / relational world. So as a first step I'd suggest a design review and make sure your current databases are in Normal Form and that the logical design makes sense for SQL Server. If they aren't then you may want to do some refactoring even before you port them over so that you can support both systems during the parallel run.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 51

Assisted Solution

by:Gustav Brock
Gustav Brock earned 400 total points
ID: 34240606
Use the DataTableAdapters of Visual Studio. Or even the Entity Framework.

These let you program in VB.NET (or C# or ..) while the underlying SQL is generated automatically behind the scene.

/gustav
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 400 total points
ID: 34243030
0
 

Author Comment

by:altiplano
ID: 34256156
So many options, so little time...
Thanks for the various answers, they were virtually all useful. Particularly some of the links CodeCruiser provided look like they give the answers I need.
regards,
Michiel
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

722 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