Click here to Skip to main content
16,012,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I have written a small piece of code to connect MS access database with Asp.net..
C#
con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " + "Data Source=" + Server.MapPath("~/MYDB.mdb"));
           con.Open();


I have hosted this website in win server 2008 it gets connected , but during insert query it says "Operation must be an updateable query"

my access db is having full rights..with full control..

whereas the same thing when hosted on win server 2003.. it doesnt gives any error..

I need it in win server 2008

To get rid of this , i have look for an another option to get connection with DSN .. but in win server 2008 i couldnt find MSAcess driver..

for this i have used 32 bit ODBC exe.. and created DSN with the db..

now i have written this piece of code :
C#
protected void Page_Load(object sender, EventArgs e)
   {
       OdbcConnection DbConnection = new OdbcConnection("DSN=MYDSN");
       try
       {

           DbConnection.Open();
       }
       catch (Exception ex) { throw ex; }
       finally { DbConnection.Close(); }
   }
But it says :

ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed


Please suggest me any way so that i could get insertion of records in MS Access through Asp.net in win server 2008

Thanks
Krunal
Posted
Comments
Maciej Los 3-May-14 7:53am    
Does MS Windows Server 2008 is 32 or 64 bit OS?
krunalpanchalN 3-May-14 7:55am    
Hi,

It is 64 bit O.S
Maciej Los 3-May-14 10:52am    
Please, use "Reply" button to post reply. OK?

1 solution

64bit Windows OS does not supports MS Jet drivers. You need to install MS Access Database Engine 2010[^] on Windows server 2008. After that, change connection string[^]:
CSS
Provider=Microsoft.ACE.OLEDB.12.0; Data Source=\\serverName\shareName\folder\myAccessFile.mdb;


Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900