Solved

Ensuring access to multiple database platforms.

Posted on 2004-08-20
7
156 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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

18 Experts available now in Live!

Get 1:1 Help Now