473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Operation must use an updateable query

Below is the code i am using to insert a record in msaccess database.
I am getting an error that bcmd must use an Updateable query.
Error screenshot is attached....

Expand|Select|Wrap|Line Numbers
  1.         Dim strsql as string, rGender as string
  2.         dim BCon As OleDbConnection
  3.         dim bcmd as OleDbCommand
  4.  
  5.             if rbMale.checked = false then 
  6.                 rGender = "Female"
  7.             else
  8.                 rGender = "Male"
  9.             end if
  10.             Bcon = New OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("/AN/db/data.mdb"))
  11.              'strsql = "INSERT INTO oApply VALUES ('" & txtUsername.text & "', '" & txtPassword.text & "', '" & txtName.text & "', '" & rGender & "', '" & txtNIC.text & "', '" & txtPassport.text & "', '" & txtPhone.text & "', '" & txtMobile.text & "', '" & txtAddress.text & "', '000')"
  12.  
  13.             strsql = "INSERT INTO oApply VALUES (@Username, @Password, @Name, @Gender, @NIC, @Passport, @Phone, @Mobile, @Address, @Date)"
  14.  
  15.             Bcon.open
  16.  
  17.             bcmd = New OleDbCommand(strsql, bcon)
  18.  
  19.             With bcmd.Parameters:
  20.                 .Add(New OleDbParameter("@Username", txtUsername.text))
  21.                 .Add(New OleDbParameter("@UPassword", txtPassword.text))
  22.                 .Add(New OleDbParameter("@Name", txtName.text))
  23.                 .Add(New OleDbParameter("@Gender", rGender))
  24.                 .Add(New OleDbParameter("@NIC", txtNIC.text))
  25.                 .Add(New OleDbParameter("@Passport", txtPassport.text))
  26.                 .Add(New OleDbParameter("@Phone", txtPhone.text))
  27.                 .Add(New OleDbParameter("@Mobile", txtMobile.text))
  28.                 .Add(New OleDbParameter("@Address", txtAddress.text))
  29.                 .Add(New OleDbParameter("@Date", "000"))
  30.             end with
  31.  
  32.             bcmd.ExecuteNonQuery()            
  33.  
  34.             bcon.close

For better view of error message: http://www.mediafire.com/file/1zkt41ownli/Capture.JPG
Attached Images
File Type: jpg Capture.jpg (19.3 KB, 110 views)
Apr 21 '10 #1

✓ answered by waqasmgl

I got my problem.... i tried many times but didnt try the error search. This problem occurs when we dont have permission to write on database folder.
I asked my server support and they gave the rights to me now its all ok...
But i m amazed that none of u knw this.

9 1522
tlhintoq
3,525 Expert 2GB
Until someone with more experience can offer more targeted advice I can point you toward these:

Database tutorial Part 1
Database tutorial Part 2
Apr 21 '10 #2
@tlhintoq
Sir my syntax is OK.... Code is all ok... but i m confused why i m getting this error?
I m using an updateable query then why the server is giving this error?
Apr 21 '10 #3
tlhintoq
3,525 Expert 2GB
Isn't it just amazing what you can find when you search?
I practically live on Google.

"MSDN MySearchTermProblemHere" is always my first effort, followed by
"C# MySearchTermProblemHere"
Apr 21 '10 #5
semomaniz
210 Expert 100+
True google is the first place to check.
Apr 21 '10 #6
I got my problem.... i tried many times but didnt try the error search. This problem occurs when we dont have permission to write on database folder.
I asked my server support and they gave the rights to me now its all ok...
But i m amazed that none of u knw this.
Apr 22 '10 #7
tlhintoq
3,525 Expert 2GB
waqasmgl: But i m amazed that none of u knw this.
No need to be nasty. It's your network. I'm amazed that you wouldn't know your own network permissions. Or how to type 'you' or 'know'.

The folks here have a fine line to walk. Do you go down to such a basic level as to ask the coder if their PC is plugged in... is your cat5 connected... do you have permissions to your own project folder... Many people would find such questions insulting.

Windows error messages are also not the always the most helpful. Often times the same message is thrown for 10 different reasons. I never thought it particularly intuitive that you get an error message of "Out of memory" if you try to open a .jpg that is still being written by another program or still being copied to the destination folder.
Apr 22 '10 #8
Frinavale
9,735 Expert Mod 8TB
Waqasmgl, thank you for sharing your solution with us.

I'm sure that other people who are facing the same problem will find this information helpful and it could save them a headache too.

-Frinny
Apr 23 '10 #9
I m so sorry for my rude behavior, that was because of tension i was facing at that time... i need to show the site to my customer the very next day and i was tensed.
Thank you very much for being understanding.
Apr 28 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

8
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...
6
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...
4
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 =...
606
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...
2
by: SheryMich | last post by:
Hi - I am having a bit of a problem with the insert into a database. When I go to insert a record into an un-keyed, single table Access database, I get the aforementioned ''Operation Must Use an...
8
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: ========================================================...
1
by: Muskito | last post by:
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...
11
by: Arpan | last post by:
I have always been working with SQL Server 2005 for ASP.NET apps but due to some reasons, had to revert back to MS-Access 2000. When I try to insert/update a MS-Access DB table (MDB), ASP.NET...
1
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...
0
by: rickmedlin | last post by:
I know this has been posted on elsewhere but I'm stuck. I'm using the following append query to copy an Access query to Excel: INSERT INTO . SELECT * FROM Test; This isn't the real table...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.