Click here to Skip to main content
15,896,500 members
Home / Discussions / Database
   

Database

 
AnswerRe: random alphanumeric generator Pin
sathish s11-May-06 2:00
sathish s11-May-06 2:00 
AnswerRe: random alphanumeric generator Pin
atandon18-Nov-09 19:53
atandon18-Nov-09 19:53 
QuestionReturning Multiple Tables from Stored Procedure Pin
Craig G Fraser11-May-06 1:24
Craig G Fraser11-May-06 1:24 
AnswerRe: Returning Multiple Tables from Stored Procedure Pin
chinnasrihari11-May-06 3:36
chinnasrihari11-May-06 3:36 
AnswerRe: Returning Multiple Tables from Stored Procedure Pin
Michael Potter11-May-06 3:38
Michael Potter11-May-06 3:38 
AnswerRe: Returning Multiple Tables from Stored Procedure Pin
Paul Brower11-May-06 4:07
Paul Brower11-May-06 4:07 
QuestionSwitch from Access to MS SQL Server Pin
armax7511-May-06 0:49
professionalarmax7511-May-06 0:49 
AnswerRe: Switch from Access to MS SQL Server Pin
Colin Angus Mackay11-May-06 1:19
Colin Angus Mackay11-May-06 1:19 
armax75 wrote:
My question is, "Is it possible to switch into a differrent back-end such as SQL to access without changing any SQL commands ? "


Generally, no!

As a possible suggestion:
You should create an abstract class that will handle data access. The interface (i.e. the public methods/properties) of the class should be database neutral. You can then create two inherited classes, one for Access specific things and one for SQL Server specific things. You then have some code (a factory method) that decides which of the derived classes to instantiate. The rest of your application only ever refers to the abstract base class.

public abstract class DataAccessObject
{
    public abstract DataSet RunSomeQuery(string param1, int param2);
}
 
public class DataAccessObjectSqlServer : DataAccessObject
{
    public override DataSet RunSomeQuery(string param1, int param2)
    {
        // SQL Server specific code here
    }
}
 
public class DataAccessObjectMSAccess : DataAccessObject
{
    public override DataSet RunSomeQuery(string param1, int param2)
    {
        // Microsoft Access specific code here
    }
}



"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)

My: Website | Blog
GeneralRe: Switch from Access to MS SQL Server Pin
armax7511-May-06 10:54
professionalarmax7511-May-06 10:54 
GeneralRe: Switch from Access to MS SQL Server Pin
Colin Angus Mackay11-May-06 11:05
Colin Angus Mackay11-May-06 11:05 
AnswerRe: Switch from Access to MS SQL Server Pin
Frank Kerrigan12-May-06 5:21
Frank Kerrigan12-May-06 5:21 
QuestionUsing INSERT to copy a table Pin
Ista10-May-06 7:44
Ista10-May-06 7:44 
AnswerRe: Using INSERT to copy a table Pin
Eric Dahlvang10-May-06 8:05
Eric Dahlvang10-May-06 8:05 
AnswerRe: Using INSERT to copy a table Pin
Chemisus10-May-06 18:26
Chemisus10-May-06 18:26 
QuestionDetaching Database on SQL server 2000 Pin
For_IT10-May-06 5:40
For_IT10-May-06 5:40 
AnswerRe: Detaching Database on SQL server 2000 Pin
Colin Angus Mackay10-May-06 7:19
Colin Angus Mackay10-May-06 7:19 
GeneralRe: Detaching Database on SQL server 2000 Pin
For_IT10-May-06 10:19
For_IT10-May-06 10:19 
AnswerRe: Detaching Database on SQL server 2000 Pin
Eric Dahlvang10-May-06 8:10
Eric Dahlvang10-May-06 8:10 
QuestionSimple change in the connection string problem... VB.net 2005 Pin
nirishere10-May-06 5:02
nirishere10-May-06 5:02 
QuestionQuery Problem? Pin
pubududilena10-May-06 1:38
pubududilena10-May-06 1:38 
AnswerRe: Query Problem? Pin
Michael Potter10-May-06 3:34
Michael Potter10-May-06 3:34 
AnswerRe: Query Problem? Pin
chinnasrihari11-May-06 3:49
chinnasrihari11-May-06 3:49 
QuestionSQL server 2000 Some friend help me Pin
AnhTin9-May-06 19:02
AnhTin9-May-06 19:02 
AnswerRe: SQL server 2000 Some friend help me Pin
Colin Angus Mackay9-May-06 21:38
Colin Angus Mackay9-May-06 21:38 
QuestionCan anyone answer my Query? Pin
Deepasubramanian9-May-06 17:29
Deepasubramanian9-May-06 17:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.