Using VB.Net 2008 with Access 2007 database on Windows Server 2008
-
This code, to open and read a local access 2007 database, works perfectly fine on my (Vista) development station:
'open the Access 2007 database without a password Dim DBconnection As OleDbConnection Dim DBcommand As OleDbCommand Dim DBdataReader As OleDbDataReader = Nothing Dim strProgramPath As String = System.AppDomain.CurrentDomain.BaseDirectory() Dim strDBfullPath As String = strProgramPath + "labs.accdb" DBconnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + strDBfullPath + ";Persist Security Info=False;") DBconnection.Open()
However, once I copy my program to the Windows Server 2008 machine as well as the same database I used for development: 1) the code above takes a long time to execute 2) .Open fails Why does it work fine on Vista, but fails on Server 2008 eventough the database on both machines are the same ? -
This code, to open and read a local access 2007 database, works perfectly fine on my (Vista) development station:
'open the Access 2007 database without a password Dim DBconnection As OleDbConnection Dim DBcommand As OleDbCommand Dim DBdataReader As OleDbDataReader = Nothing Dim strProgramPath As String = System.AppDomain.CurrentDomain.BaseDirectory() Dim strDBfullPath As String = strProgramPath + "labs.accdb" DBconnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + strDBfullPath + ";Persist Security Info=False;") DBconnection.Open()
However, once I copy my program to the Windows Server 2008 machine as well as the same database I used for development: 1) the code above takes a long time to execute 2) .Open fails Why does it work fine on Vista, but fails on Server 2008 eventough the database on both machines are the same ?so the problem here seemed to exist because the compilation was set to "any CPU". Once I set the compilation option to x86, the application was able to open the database on the Server 2008 machine too (64bit machine). So it seems there's no 64bit driver to access an Access 2007 DB ? I'm glad it's at least working now, however, on my (32bit) Vista development station the data access is very fast and on the (64bit) Server 2008 station data access is very slow; instant vs. 30 secs
-
so the problem here seemed to exist because the compilation was set to "any CPU". Once I set the compilation option to x86, the application was able to open the database on the Server 2008 machine too (64bit machine). So it seems there's no 64bit driver to access an Access 2007 DB ? I'm glad it's at least working now, however, on my (32bit) Vista development station the data access is very fast and on the (64bit) Server 2008 station data access is very slow; instant vs. 30 secs
-
so the problem here seemed to exist because the compilation was set to "any CPU". Once I set the compilation option to x86, the application was able to open the database on the Server 2008 machine too (64bit machine). So it seems there's no 64bit driver to access an Access 2007 DB ? I'm glad it's at least working now, however, on my (32bit) Vista development station the data access is very fast and on the (64bit) Server 2008 station data access is very slow; instant vs. 30 secs
abiemann wrote:
So it seems there's no 64bit driver to access an Access 2007 DB ?
True, at this time there is no 64-bit drivers for a Jet database (Access). Since you cannot mix 64 and 32 bit code in the same process, you have no choice but to compile your app forced down to 32-bit only. If you used any of the SQL Servers, including SQL Server Express Edition, you wouldn't have this problem.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...