How can I fix this Error ?

I use ODBC to connect to Excel file and when I insert or update data on that file I get the following error.
I am writing Windows App.
Error[HY000][Micorsoft][ODBC Excel Driver] Operation must use an updateable query

I have checked sql command text. It OK.
Please help me solve this problem !
Thanks in advance !

[451 byte] By [pvphuc] at [2007-12-25]
# 1
please post the entire code where you are performing the operations on
ahmedilyas at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2

Usually you get this error when the xls file (or the odbc data source) is read only. When you create the ODBC data source in the Select Workbook dialog you have a Read Only checkbox that is checked by default. Uncheck it and try again.

MikeDanes at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 3
I just used a connectionString like this:
"driver={microsoft excel driver (*.xls)};dbq=D:\Study\Delphi\Check\Excel Files\MemberList.xls"
for my ODBCConnection.
And a simple sql command :
"insert into [sheet1$] values
('"+ txtID.Text+"','"+txtName.Text+"','"+txtDate.Text+"','"+txtPlace.Text+"')";

If I use OledbConnection it OK.

Please tell me what this problem is.
Thanks!

pvphuc at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 4

Add ReadOnly=false to your connection string like this:

"driver={microsoft excel driver (*.xls)};dbq=D:\Study\Delphi\Check\Excel Files\MemberList.xls;ReadOnly=false"

MikeDanes at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified