Solved

Ensuring access to multiple database platforms.

Posted on 2004-08-20
7
182 Views
Last Modified: 2010-04-23
I am developing my first asp.net/vb.net application. During my previous classic asp projects, I always had problems when I need to switch from MS Access to MS SQL or heaven forbid, to postgre or mysql...

How can I ensure, during development, that I (at least) stay compatible with both MS Access and MS SQL? It would be nice to support the others too, but both MS platforms will be critical.
0
Comment
Question by:smetterd
[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
7 Comments
 
LVL 28

Expert Comment

by:iboutchkine
ID: 11854433
Add Imports for every database you can use
for Access
Imports System.Data.OleDb
 for SQL Server
Imports System.Data.SqlClient

etc

Define different connection string for different database. The rest is the same
0
 
LVL 2

Author Comment

by:smetterd
ID: 11859218
I am confused... I thought there was a lot more to it than that... for instance, different tweaks in syntax for queries?
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 11881201
DIfferences:
1.Imports
2.Connection string
3.SQL (depending on the database)
0
Industry Leaders: 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 2

Author Comment

by:smetterd
ID: 11888255
Thanks y'all, but I was looking for a full scale, easily-understood plan for making my app compliant with at least both access and mssql. So far, we've just (among ourselves) agree that, yes, there are some differences.
0
 
LVL 2

Author Comment

by:smetterd
ID: 11888259
iboutchkine, are you saying just to keep developing, but while doing so make sure that I import both namespace differences, and every time I write some SQL to test it on both DB's to ensure it works?
0
 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
ID: 11891858
You can have Select case

Select Case DB
  Case "Access"
     ConnectionString=...
     SQL = ...
  Case "SQLServer"
     ConnectionString=...
     SQL = ...
End Select

etc
0
 
LVL 2

Author Comment

by:smetterd
ID: 11898518
Good, that's what I've started doing.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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