I have created a new website . With access db inside app data folder. . And hosted in server. . Bt it is not retrieving, inserting or updating db datas . Why it is happening ?
The Website is already published with Db inside App_Data Folder. But it is not reading , inserting or updating db.
By the way, when you use a mdb file, you better use the Jet.OleDb.4.0 driver, because the new ACE driver may not be installed on you production server:
itsvineethpv
Member
142 Points
144 Posts
Databse not retrieving, inserting or updating db datas . Why it is happening ?
Feb 29, 2012 05:17 AM|LINK
I have created a new website . With access db inside app data folder. . And hosted in server. . Bt it is not retrieving, inserting or updating db datas . Why it is happening ?
The Website is already published with Db inside App_Data Folder. But it is not reading , inserting or updating db.
The Conncection string iam using is,
ConnectToAccess = Provider=Microsoft.ACE.OLEDB.12.0;Data Source =|DataDirectory|DBName.mdb;Persist Security Info=False;";
And i fixed all the Web compatibility issues of the MS Access . But No Change is there.
ignatandrei
All-Star
134535 Points
21583 Posts
Moderator
MVP
Re: Databse not retrieving, inserting or updating db datas . Why it is happening ?
Feb 29, 2012 05:20 AM|LINK
code for insert, please.
itsvineethpv
Member
142 Points
144 Posts
Re: Databse not retrieving, inserting or updating db datas . Why it is happening ?
Feb 29, 2012 05:24 AM|LINK
I Already have Some datas in Database which are added while creating webpages. But i cannot loggin using the same credentials now .
itsvineethpv
Member
142 Points
144 Posts
Re: Databse not retrieving, inserting or updating db datas . Why it is happening ?
Feb 29, 2012 06:22 AM|LINK
When i hosted in another server. It is reading the value and i am able Login. But Update,Delete and insert is not still working.
daisydain
Member
222 Points
51 Posts
Re: Databse not retrieving, inserting or updating db datas . Why it is happening ?
Feb 29, 2012 07:13 AM|LINK
Hello,
Please post your code here . We might be able to help you better.
itsvineethpv
Member
142 Points
144 Posts
Re: Databse not retrieving, inserting or updating db datas . Why it is happening ?
Feb 29, 2012 07:20 AM|LINK
accessstat = "insert into tblFixedDates ([PropertyID],[FixDate],[Percentage],[Type])";
accessstat = accessstat + " values(" + pricing.PropertyID + ",'" + pricing.FixDate + "'," + pricing.Discount + ",'" + pricing.Type + "')";
This is the query for update
Datahelper - method is
con = new OleDbConnection(ConnectToAccess);
cmd = new OleDbCommand(Query, con);
con.Open();
chk = cmd.ExecuteNonQuery();
itsvineethpv
Member
142 Points
144 Posts
Re: Databse not retrieving, inserting or updating db datas . Why it is happening ?
Feb 29, 2012 07:29 AM|LINK
It is reading the value perfectly . But No modification or adding is possible here. Any File Permissions is there to set ?
hans_v
All-Star
35986 Points
6550 Posts
Re: Databse not retrieving, inserting or updating db datas . Why it is happening ?
Feb 29, 2012 08:27 AM|LINK
Read this:
http://www.mikesdotnetting.com/Article/74/Solving-the-Operation-Must-Use-An-Updateable-Query-error
Once you fixed it, you also need to read this:
http://www.mikesdotnetting.com/Article/26/Parameter-Queries-in-ASP.NET-with-MS-Access
hans_v
All-Star
35986 Points
6550 Posts
Re: Databse not retrieving, inserting or updating db datas . Why it is happening ?
Feb 29, 2012 09:48 AM|LINK
By the way, when you use a mdb file, you better use the Jet.OleDb.4.0 driver, because the new ACE driver may not be installed on you production server:
http://www.mikesdotnetting.com/Article/78/AccessDataSource-SqlDataSource-and-connecting-to-Access-databases-in-ASP.NET
itsvineethpv
Member
142 Points
144 Posts
Re: Databse not retrieving, inserting or updating db datas . Why it is happening ?
Mar 01, 2012 03:27 AM|LINK
Thanks for your reply . I will work on this today.
Is it must to change the queries to this format that you described in the follwing blog ?
http://www.mikesdotnetting.com/Article/26/Parameter-Queries-in-ASP.NET-with-MS-Access