Access 2003 Error

G

Guest

Hello

I used C# for ASP.NET and used ADO.NET to connect Access 2003 file. Every thing was ok, when I used "Select" instructions. But, when I want to "Write" the database, like "Delete and Insert", the error was happen. I checked the file and IIS, it's not readonly. Dose anyone want to help me

The codes is here

OleDbConnection Conn
OleDbCommand Command
string ConnectionStr

ConnectionStr = "Data Source=C:\\Inetpub\\wwwroot\\\\Data\\Test.mdb;Provider=Microsoft.Jet.OLE"
"DB.4.0"
Conn = new System.Data.OleDb.OleDbConnection(ConnectionStr)
string queryStr="delete from UserData where ID='exUser'"
Command = new OleDbCommand()
Command.Connection=Conn
Command.CommandText=queryStr
Conn.Open();
Command.ExecuteNonQuery()
Conn.Close();
 
P

Paul Clement

¤ Hello:
¤
¤ I used C# for ASP.NET and used ADO.NET to connect Access 2003 file. Every thing was ok, when I used "Select" instructions. But, when I want to "Write" the database, like "Delete and Insert", the error was happen. I checked the file and IIS, it's not readonly. Dose anyone want to help me?
¤
¤ The codes is here:
¤
¤ OleDbConnection Conn;
¤ OleDbCommand Command;
¤ string ConnectionStr;
¤
¤ ConnectionStr = "Data Source=C:\\Inetpub\\wwwroot\\\\Data\\Test.mdb;Provider=Microsoft.Jet.OLE" +
¤ "DB.4.0";
¤ Conn = new System.Data.OleDb.OleDbConnection(ConnectionStr);
¤ string queryStr="delete from UserData where ID='exUser'";
¤ Command = new OleDbCommand();
¤ Command.Connection=Conn;
¤ Command.CommandText=queryStr;
¤ Conn.Open();
¤ Command.ExecuteNonQuery();
¤ Conn.Close();

Make certain that the ASPNET account has sufficient permissions:

http://support.microsoft.com/default.aspx?scid=kb;en-us;316675&Product=aspnet

Also, you may want to indicate what error you are receiving.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top