Z
ZenRhapsody
I am working on an application where the end user will select the type of
datastorage to use (SQL, Oracle, Access, even Excel for some readonly data,
and maybe more providers )
The application reads/writes data and even must be able to create tables in
databases (or even create databases) as needed.
I am trying to use the new DbCommon namespace in ADO 2.0 to keep the
database code as generic as possible. However, as we all know, there are
many nuances between the common data providers that make this difficult.
For example date formats in queries are different (JET, at least before
Access 2003, requires '#' delimiters), cultural settings can work
differently with Access/Excel JET (m/d/y or d/m/y). Syntax for creating
tables are also different (nvarchar(1000) crashes in JET because text fields
in JET are limited to 255 characters so you must use MEMO).
So, while I can write a lot of DB independent code, I need specifics in many
cases. While working to this end, I can't even find a simple way to query
a connection to see who it's driver is!! I've used if (conn is
System.Data.SqlClient.SqlConnection) ,is there a better way? I've also
written query formatters for date parameters.
Who out there has a little more experience to share? Some tricks, pitfalls,
links to good provider comparision imformation, anything would be helpful!
datastorage to use (SQL, Oracle, Access, even Excel for some readonly data,
and maybe more providers )
The application reads/writes data and even must be able to create tables in
databases (or even create databases) as needed.
I am trying to use the new DbCommon namespace in ADO 2.0 to keep the
database code as generic as possible. However, as we all know, there are
many nuances between the common data providers that make this difficult.
For example date formats in queries are different (JET, at least before
Access 2003, requires '#' delimiters), cultural settings can work
differently with Access/Excel JET (m/d/y or d/m/y). Syntax for creating
tables are also different (nvarchar(1000) crashes in JET because text fields
in JET are limited to 255 characters so you must use MEMO).
So, while I can write a lot of DB independent code, I need specifics in many
cases. While working to this end, I can't even find a simple way to query
a connection to see who it's driver is!! I've used if (conn is
System.Data.SqlClient.SqlConnection) ,is there a better way? I've also
written query formatters for date parameters.
Who out there has a little more experience to share? Some tricks, pitfalls,
links to good provider comparision imformation, anything would be helpful!