Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Ensuring access to multiple database platforms.

Posted on 2004-08-20
7
Medium Priority
?
187 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
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 1500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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 …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Screencast - Getting to Know the Pipeline

864 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