473,770 Members | 6,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Operation must use an updateable query EXCEPTION when trying to update excel

HELP!!!

Hello All,

I'm using VB.net 2003 and trying to update data in Excel worksheet.

The program selects data from the excel, updates something in the MSSQL
DB and then tries to update something back to the excel worksheet.

My problem is that i'm having this annoying exception: "Operation must
use an updateable query"
1. The excel worksheet is on the desktop
2. The file has full permission for Everyone
3. The Folder has full permission for Everyone

The code looks like this:

Dim oConnection As System.Data.Ole Db.OleDbConnect ion
oConnection = New System.Data.Ole Db.OleDbConnect ion( _
"provider=Micro soft.Jet.OLEDB. 4.0; " & _
"data source=" & txtFile.Value & ";" & _
"Extended Properties='Exc el 8.0;IMEX=1'")
oConnection.Ope n()
Dim sCmd As String = "UPDATE [" & txtSheetName.Va lue & "$] SET " &
dsExcel.Tables( 0).Columns(13). ColumnName & " = '" &
oRow.ClientNumb erInServiceGive r & "' WHERE F8 = '1549461305'"
Dim oCommand As New OleDb.OleDbComm and(sCmd)
oCommand.Connec tion = oConnection
oConnection.Ope n()
oCommand.Execut eNonQuery()

the sCmd looks like this when it is running:
"UPDATE [Sheet1$] SET F14 = '7370037530-3' WHERE F8 = '1549461305'"

Does anyone have any idea for why this problem occurs?...

Thanks in advance.

May 10 '06 #1
1 3583
I had this same issue a while back in Access with a linked Excel file.
The damn thing isn't updateable! I don't understand it. Never found a
way to update it, either. I had to build a new spreadsheet with the
new data.

T

Muskito wrote:
HELP!!!

Hello All,

I'm using VB.net 2003 and trying to update data in Excel worksheet.

The program selects data from the excel, updates something in the MSSQL
DB and then tries to update something back to the excel worksheet.

My problem is that i'm having this annoying exception: "Operation must
use an updateable query"
1. The excel worksheet is on the desktop
2. The file has full permission for Everyone
3. The Folder has full permission for Everyone

The code looks like this:

Dim oConnection As System.Data.Ole Db.OleDbConnect ion
oConnection = New System.Data.Ole Db.OleDbConnect ion( _
"provider=Micro soft.Jet.OLEDB. 4.0; " & _
"data source=" & txtFile.Value & ";" & _
"Extended Properties='Exc el 8.0;IMEX=1'")
oConnection.Op en()
Dim sCmd As String = "UPDATE [" & txtSheetName.Va lue & "$] SET " &
dsExcel.Tables (0).Columns(13) .ColumnName & " = '" &
oRow.ClientNum berInServiceGiv er & "' WHERE F8 = '1549461305'"
Dim oCommand As New OleDb.OleDbComm and(sCmd)
oCommand.Conne ction = oConnection
oConnection.Op en()
oCommand.Execu teNonQuery()

the sCmd looks like this when it is running:
"UPDATE [Sheet1$] SET F14 = '7370037530-3' WHERE F8 = '1549461305'"

Does anyone have any idea for why this problem occurs?...

Thanks in advance.

May 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
902
by: Tom wilson | last post by:
This is driving me nuts. I'm trying to update an Excel spreadsheet using ADO.Net and Oledb in VB.Net. The connection is open, the adapter is connected and the dataset is loaded. Here's the code in question: myDataRow = myDataSet.Tables(0).Rows(RowNum) myDataRow(ColumnCount) = Ailment Adapter.UpdateCommand = New OleDbCommand("UPDATE SET F" & ColumnCount & " = '" & Ailment & "' where F1 = " & RowNum & "", Conn)...
6
7564
by: ano1optimist | last post by:
I have been running these queries in Access 2000 with no problems. This week, I had to install Access 2003 to create some runtime versions for another application, and now I keep getting "operation must be an updateable query" messages when I try to run the same old queries. Here is a sample of one that is no longer working: UPDATE Personnel INNER JOIN dbo_personnel ON .= dbo_personnel. SET personnel. = dbo_personnel.,...
4
6506
by: MDW | last post by:
Hey all. I'm confused. I'm trying to add a single record into an Access 2000 database using ASP.Net. Here is the code: objConn = New OleDbConnection(strConnect) objConn.Open objCommand = New OleDbCommand("INSERT INTO LOGIN_MASTER (LOGIN_ID, PWD, F_NAME, L_NAME, TYPE_ID) VALUES ('" & strEmail & "','" & strPwd & "','" &
606
14776
by: Neil Zanella | last post by:
Hello, I am trying to update an MS access database from ASP.NET. I am using IIS on Windows XP Pro. I can issue SELECT statements from ASP.NET using ADO.NET but I cannot seem to be able to carry out INSERT statements. Here is the error which I am getting: Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.
4
302
by: Derek Van Cuyk | last post by:
Hi everyone! I'm trying to write a web application in school that utilizes a MS Access database. I can read and everything fine from it but when I try to add a new record I get an exception that states: "Operation must use an updateable query" I know it has to do with the update command on the OleDbDataAdapter. I've tried looking for the problem on the net and newsgroups but I don't seem to have the same problems as everyone else. Please,...
8
3007
by: Jim in Arizona | last post by:
I've been using an example out of a book to be able to edit the rows in a database. I am getting the following error: ======================================================== ======================================================== Server Error in '/' Application. -------------------------------------------------------------------------------- Operation must use an updateable query. Description: An unhandled exception occurred during...
4
15758
by: Mike D | last post by:
OS: Windows XP Professional Microsoft Access 2003 I am trying to update a table in my DB from a tempory table. I need to ensure that if records in the main table match records in the temp table (on the keys) they are replaced/updated by the new data in the temp table. the vba code i am running is below: Dim mySQL As String
3
3660
by: Lewe22 | last post by:
PLEASE HELP!! I am trying to update a table which is held in a SQL database, from Access. I have written the following SQL statement which runs perfectly as either a PTQ in Access or even run from SQL Tools 1.4.2. UPDATE unit_instance_occurrences uio SET fes_active_places = (SELECT COUNT(*) FROM registration_units ru WHERE ru.fes_unit_instance_code = uio.fes_uins_instance_code
1
2756
by: pavya | last post by:
Hi, I have developed one Web application. At that time my system had a FAT file system on it and this application worked properly. But now i have converted FAT file system to NTFS file system and whenever i am trying to run this application then it through the exception. I have used MS Access as a database. The error is as follows... Server Error in '/ASG' Application....
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8880
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.