A
Alex Stevens
Hi all,
I've already written a DAL for SQL server which I'm pretty happy with.
I want to use this as the basis for a MSACCESS flavour and would appreciate
som guidance with the SQL others are using to build their MSACCESS DAL's.
As I see it, in my MSSQL DAL I have three methods for interaction with the
database.
They are:
Load() - which uses a stored procedure with a SELECT statement to populate a
datatable with a row.
Delete() - which uses a stored procedure with a DELETE SQL statement on a
command to delete a row.
Save() - which uses a stored procedure which has an If to decide whether a
UPDATE or INSERT statement is carried out.
The problem that I have is with the save method, as with the Load() and
Delete() methods I just execute SELECT AND DELETE SQL statements against the
access database.
In my MSSQL DAL when the SAVE method is called, it executes a stored
procedure which has a parameter for each field and passes in the values. If
the primary key parameter/field is populated (ie not 0) it executes a UPDATE
statement as the row already exists, and if it doesn't exist it executes a
INSERT statement.
How do I create the same in Access SQL, as the INSERT statement requries a
table in the FROM clause?
I'm not inserting from a table, I'm using parameter values!!!!
How can I execute a single SQL statement which will insert a record into an
MSACCESS table?
How should I write the UPDATE statement.
I don't want to have to create queries in the access database, I want to use
in-line SQL called using a OLEDB command??
If you need any further embelishment on any of the issues feel free to post,
and I'll promptly reply.
Any help or guidance is gratefully received!!!!!
Thanks
Alex Stevens
I've already written a DAL for SQL server which I'm pretty happy with.
I want to use this as the basis for a MSACCESS flavour and would appreciate
som guidance with the SQL others are using to build their MSACCESS DAL's.
As I see it, in my MSSQL DAL I have three methods for interaction with the
database.
They are:
Load() - which uses a stored procedure with a SELECT statement to populate a
datatable with a row.
Delete() - which uses a stored procedure with a DELETE SQL statement on a
command to delete a row.
Save() - which uses a stored procedure which has an If to decide whether a
UPDATE or INSERT statement is carried out.
The problem that I have is with the save method, as with the Load() and
Delete() methods I just execute SELECT AND DELETE SQL statements against the
access database.
In my MSSQL DAL when the SAVE method is called, it executes a stored
procedure which has a parameter for each field and passes in the values. If
the primary key parameter/field is populated (ie not 0) it executes a UPDATE
statement as the row already exists, and if it doesn't exist it executes a
INSERT statement.
How do I create the same in Access SQL, as the INSERT statement requries a
table in the FROM clause?
I'm not inserting from a table, I'm using parameter values!!!!
How can I execute a single SQL statement which will insert a record into an
MSACCESS table?
How should I write the UPDATE statement.
I don't want to have to create queries in the access database, I want to use
in-line SQL called using a OLEDB command??
If you need any further embelishment on any of the issues feel free to post,
and I'll promptly reply.
Any help or guidance is gratefully received!!!!!
Thanks
Alex Stevens