Developer forum

Forum » Development » SQL Server vs. Access

SQL Server vs. Access


Reply

 


1) I'm not sure I remember this correctly or not, but is it correct that (seen from code like a custom module for example) it makes no difference if the solution is using SQL Server or Access... The code would still be the same?


2) Also, if the above is correct then how about using transactions, is this available when communicating through Dynamicweb.Database or should a real SqlConnection, SqlCommand etc. be used?


3) Futhermore, the web interface for SQL Server, where is that located for solutions using SQL Server?


Replies

 
Nicolai Høeg Pedersen
Reply
pl@xtendit.dk wrote:


 




1) I'm not sure I remember this correctly or not, but is it correct that (seen from code like a custom module for example) it makes no difference if the solution is using SQL Server or Access... The code would still be the same?






2) Also, if the above is correct then how about using transactions, is this available when communicating through Dynamicweb.Database or should a real SqlConnection, SqlCommand etc. be used?






3) Futhermore, the web interface for SQL Server, where is that located for solutions using SQL Server?





1) Yes - Dynamicweb uses OLEDB if on access and SQLClient if running on SQL-Server. Just make sure you use Database.SqlDate(now) and Database.SqlBool(True) when using dates and booleans in your queries.


 


2) Transactions are not available everywhere, but you can execute long running deletes etc with


Database.ExecuteNonQuery() using transactions - it has a bollean you can set so it will use transactions if possible (running SQL-Server)


 


3) Please ask this question in support (Case system). I think they need to create a user for you first.

 
Reply
NP wrote:

pl@xtendit.dk wrote:





 








1) I'm not sure I remember this correctly or not, but is it correct that (seen from code like a custom module for example) it makes no difference if the solution is using SQL Server or Access... The code would still be the same?














2) Also, if the above is correct then how about using transactions, is this available when communicating through Dynamicweb.Database or should a real SqlConnection, SqlCommand etc. be used?














3) Futhermore, the web interface for SQL Server, where is that located for solutions using SQL Server?










1) Yes - Dynamicweb uses OLEDB if on access and SQLClient if running on SQL-Server. Just make sure you use Database.SqlDate(now) and Database.SqlBool(True) when using dates and booleans in your queries.




 




2) Transactions are not available everywhere, but you can execute long running deletes etc with




Database.ExecuteNonQuery() using transactions - it has a bollean you can set so it will use transactions if possible (running SQL-Server)




 




3) Please ask this question in support (Case system). I think they need to create a user for you first.





About (2), this means that the following wold not work?


 


---------------------------


IDbConnection con = Dynamicweb.Database.GetConn();


 


IDbTransaction trans = con.BeginTransaction();


IDbCommand cmd = con.CreateCommand();


cmd.Transaction = trans;


...


...


...


trans.commit();


// or, on error


trans.Rollback();


---------------------------


This works in general using SqlConnection, SqlCommand etc. when coding for SQL Server.

 
Nicolai Høeg Pedersen
Reply

That should work provding you are using SQL-Server.


 


If you want you can just ctype the connection returned from Database.getcon to an sqlclient connection.

 
Reply
NP wrote:


That should work provding you are using SQL-Server.




 




If you want you can just ctype the connection returned from Database.getcon to an sqlclient connection.





Actually I've just tried it on an Access version (not changing object types) and however wiered it may sound it appears to work.


What's actually performing the transaction handling (Access or .NET Framework) I'm not sure, but it appears to work.


It's Access 2007 i'm using, but I'm not sure that makes any difference.


If the general behaviour is that it's working, obviously I'd rather keep the object types as is.


 

 
Reply

I don't see why it shouldn't work. Access to supports transactions and we make usage of this support in Dynamicweb also e.g. when updating solutions.


 


Or am I missing the point here:)

 
Nicolai Høeg Pedersen
Reply
Sorensen wrote:


I don't see why it shouldn't work. Access to supports transactions and we make usage of this support in Dynamicweb also e.g. when updating solutions.




 




Or am I missing the point here:)




No you are not missing the point - my knowledge is just too poor. It will never happen again :)
 
Reply
NP wrote:

Sorensen wrote:





I don't see why it shouldn't work. Access to supports transactions and we make usage of this support in Dynamicweb also e.g. when updating solutions.








 








Or am I missing the point here:)








No you are not missing the point - my knowledge is just too poor. It will never happen again :)


Just gonna print this out and put it in a nice frame...;)

 

You must be logged in to post in the forum