Solved

Ensuring access to multiple database platforms.

Posted on 2004-08-20
7
144 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
  • 4
  • 3
7 Comments
 
LVL 28

Expert Comment

by:iboutchkine
Comment Utility
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
Comment Utility
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
Comment Utility
DIfferences:
1.Imports
2.Connection string
3.SQL (depending on the database)
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 2

Author Comment

by:smetterd
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Good, that's what I've started doing.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now