Re: Common database code for Oracle, SQL Server, MS Access

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Morten Mertner (morten_at_mertner.com)
Date: 03/04/04


Date: Fri, 05 Mar 2004 00:51:50 +0100

You should use a persistence framework to provide an additional layer of
abstraction. I've written one and released it as open source (LGPL,
which means you can use it in commercial apps too). It's called Gentle
and currently supports SQL Server, Access/Jet/Ole, MySQL, PostgreSQL,
SQLite. Firebird/Interbase support is in the works.

It generates all the sql for simple object IO and provides an SqlBuilder
for constructing more complicated queries. It does not support n:m
relations at the moment, so if you need complicated joins you have to
execute custom sql, but can still benefit from the other features (such
as automatic result parsing and object construction).

You can visit the workspace (and download the latest source) here:
http://workspaces.gotdotnet.com/gentle

I realise this all sounds a bit marketing-like, but I really believe in
the benefit of using such a framework. ObjectSpaces is similar (in
features if not in approach) but is unlikely to support very many
databases (at least for quite a while). There's also something called
Matchbox, which is similar to Gentle but less advanced. Also, there is
OJB.NET, which looks very nice but probably doesn't perform (it uses
ContextBound objects and ContextAttributes afaik). There's also a ton of
commercial apps available if you have the dough.

If you wish to go with Gentle, there's a quick-start tutorial here:
http://www.mertner.com/projects/gentle

Yours,
Morten

Raj wrote:
> I am writting an application in VB.Net, as part of programming I realize that depending on what database I connect to Access, SQL Server or Oracle, I have to use a different SQL Query Syntax... and include different type of database libraries in my code.
>
> In phase one we want to develop the app on MS Access and later on wants to migrate to Oracle or SQL Server.
>
>
>>>What do I need to do to write the code in such a way that I don't have to rewrite any code when I migrate the app from MS Access to SQL Server or Oracle? Can I just use ODBC connection all across? Will ODBC work on ACCESS from VB.Net?
>
>
> Thanks in advance,
> -Raj



Relevant Pages

  • Re: What so special about PostgreSQL and other RDBMS?
    ... Part of the beauty of SQL is that there are standards which if you try and stick ... PostreSQL really does support a lot, ... missing the speed, tools, and high-availability addons of MS SQL Server. ... Microsoft; open source or not. ...
    (comp.lang.php)
  • SQL 2008 Upgrade Bug
    ... I had a similar situation and after calling MS support it turns out there is a bug in the SISS that will prevent the upgrade of an expired evaluation edition. ... I am not sure if you have unintalled the SQL Server and then reinstalled it. ... In this case I recommend that you contact Microsoft Customer Support Services ...
    (microsoft.public.sqlserver.setup)
  • RE: Configuration parameter in SQL database
    ... Welcome to Microsoft Newsgroup Support Service! ... how to store&return the configuration ... SQL Server + SQL Dependency Cache ...
    (microsoft.public.dotnet.general)
  • Re: New DBD::ODBC 1.24_3 development release
    ... Unfortunately I missed an sv_undef out - thanks smoke testers for spotting that. ... Added a FAQ entry for how "use regional settings" in MS SQL Server ... Started adding support for DBI's DiscardString and StrictlyTyped but not ...
    (perl.dbi.users)
  • RE: Connection Open Exemptions
    ... If the user can log into SQL server using QA, ... The user account can be either Windows account or SQL account. ... that you open a Support incident with Microsoft Product Support Services ...
    (microsoft.public.sqlserver.connect)