473,326 Members | 2,048 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,326 software developers and data experts.

Help for Update a Recordset

I am doing a project with VB6 and Access
usin DSN Method.
But I cant run the edit command
When clicking on Update Button then
Run time Error is Comming

i.e.

Run-time error- '2147217900 (80040e14)':
[Microsoft][ODBC Microsoft access Driver] Extra) in queryexpression"a')


The code i used in project is given below

Private Sub CMDAddNew_Click()
If CMDAddNew.Caption = "&Save" Then
CNN.Execute "INSERT INTO TB_Details Values ('" & TXTRegNo & "','" & TXTName & "'," & _
"'" & TXTAddress & "','" & CMBDistrict & "','" & TXTDesignation & "'," & _
"'" & TXTSubject & "', '" & TXTQualification & "','" & TXTExperience & "','" & TXTRemarks & "')"
MsgBox "Data saved Successfully", vbInformation, "Save"
Clearall
Frame1.Enabled = False
CMDAddNew.Caption = "Add &New"
Else
If CMDAddNew.Caption = "&Update" Then
CNN.Execute "UPDATE TB_Details SET RegNo = '" & TXTRegNo & "', Name = '" & TXTName & "'," & _
"Address = '" & TXTAddress & "', District = '" & CMBDistrict & "',Designation = '" & TXTDesignation & "'," & _
"Subject = '" & TXTSubject & "', Qualifications = '" & TXTQualification & "', Experience = '" & TXTExperience & "', Remarks = '" & TXTRemarks & "')" & _
"WHERE RegNo = '" & TXTRegNo & "'"
MsgBox "Data Updated Successfully", vbInformation, "Save"
CMDAddNew.Caption = "Add &New"
End If
'Else
'Frame1.Enabled = True
' CMDAddNew.Caption = "&Save"
' TXTRegNo.SetFocus
End If
End Sub

Pls Help for correcting the project

With regards

Manoj thanal
Aug 11 '08 #1
1 933
debasisdas
8,127 Expert 4TB
simply try this format for any DML operation.
Expand|Select|Wrap|Line Numbers
  1. conn.BeginTrans  ' conn is the ADODB connection object.
  2. conn.Execute "your sql statment here"
  3. conn.CommitTrans
  4.  
Aug 11 '08 #2

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

Similar topics

6
by: Alan Silver | last post by:
Hello, I have an ASP that takes a connection string and SQL statement in the querystring and is supposed to return the XML representation of the recordset to the Response stream (don't worry,...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
9
by: tym | last post by:
HELP!!! I'm going round the twist with this... I have a VB6 application which is using DAO to access a database (Please - no lectures on ADO, I know what I'm doing with DAO!!) Ok, problem...
2
by: Joseph Markovich | last post by:
I'm having some trouble with VB in Access 2000. I have a form that the user enters in just one number (in this case, it's a base salary) and then the program is going to do a bunch of math (which...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
1
by: Gary | last post by:
HI, I'm facing a problem while updating a ADO recordset after modifying its records using the Dataset( ADO.Net). I'm calling a method of a COM component from C# code. The method returns a ...
5
by: Hexman | last post by:
I've come up with an error which the solution eludes me. I get the error: >An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in HRTest.exe > >Additional...
10
by: 60325 | last post by:
This is the page where I collect the data in drop-down boxes with values of 1-10 and send it to a submitted page to do calculations. Example: Employee1 TeamScore(1-10) Employee2 ...
1
by: corsibu | last post by:
hello , i just wanted to ask if there's anyone who could help me do the following thing : i have an empty temporary table, this table will have a row filled with data grabbed by a querry at this...
1
by: teenagelcruise | last post by:
hi, i have a problem with my code which is i cannot update and addnew data into the database but i can delete the data.plz give me an idea.this is my code that i wrote. <html> <head> <meta...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.