473,782 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb6 adodc1.recordse t.addNew error

28 New Member
the following code works but if I try to add a second record it erases the first record in the database (using Access DB)

Expand|Select|Wrap|Line Numbers
  1. ...
  2. Me.Adodc1.Recordset.AddNew
  3.     Me.Adodc1.Recordset.Fields("Account").Value = Me.txtACNum.Text
  4.     Me.Adodc1.Recordset.Fields("Title").Value = Me.cboTitle.Text
  5.     Me.Adodc1.Recordset.Fields("First_Name").Value = Me.txtFName.Text
  6.     Me.Adodc1.Recordset.Fields("Last_Name").Value = Me.txtLName.Text
  7.     Me.Adodc1.Recordset.Fields("Address").Value = Me.txtCAddr1.Text
  8.     Me.Adodc1.Recordset.Fields("Address2").Value = Me.txtCAddr2.Text
  9.     Me.Adodc1.Recordset.Fields("Parish").Value = Me.cboCParish.Text
  10.     Me.Adodc1.Recordset.Fields("Telephone").Value = Me.txtCTel.Text
  11.     Me.Adodc1.Recordset.Fields("CEmail").Value = Me.txtCEmail.Text
  12. Me.Adodc1.Recordset.Update
  13. Me.Adodc1.Recordset.Requery
  14. Me.Adodc1.Recordset.MoveFirst
  15.  
  16.  
Aug 30 '10 #1
0 1681

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

Similar topics

2
2609
by: sunj | last post by:
My database completely works in Dreamweaver MX at a local testing level, but as soon as I upload and access my web pages remotely I get this error on the browser. Can anyone help? ADODB.Recordset.1 error '80004005' SQLState: IM002 Native Error Code: 0 Data source name not found and no default driver specified
2
15580
by: Harold | last post by:
Sat I have a customers table with the fields CustomerID and Customer and I use the recordset.addnew method to add a new record to the table. What is the best way to get the CustomerID of the new record after recordset.update is executed? Recordset!CustomerID doesn't work because the recordset bookmark is on the first record. Moving to the last record doesn't work if the recordset is based on a query and the recordset is sorted. Thanks! ...
4
1281
by: linda williams via AccessMonster.com | last post by:
The code creating the recordset that is commented out below works on all my user's machines except two. What is especially irritating is that this code did work on one of their machine for several months. In trying to fix a different problem he was having with the app MS office XP was reloaded twice just to make sure everything was loaded. Various internals were also looked at. We know its the machine problem because the user can login onto...
3
6901
by: Nathan Bloomfield | last post by:
Hi there, I am having difficulty with a piece of code which would work wonders for my application if only the error trapping worked properly. Basically, it works as follows: - adds records from rsSource into rsDest - if it finds a key violation then it deletes the current record from rsDest and adds the new record from rsSource. This works perfectly - but only for the first found duplicate record, it brings up the error
1
5461
by: | last post by:
I am trying to add a new record to an odbc data base. I am using MS ActiveX library2.8. The syntax is recordset.AddNew (object fieldlist, object values). Object fieldlist and values can be one field/value or can be an array of fields and values. My problem is I do not know how to set up the array for this to work. I try the following: string fn = new string={"Name_of_the_field", "Name_of_the_field"}; string fv=new string =...
5
25462
by: tony010409020622 | last post by:
I just spent 4 months taking a dotnet class where i learned very little. One of the things I did not learn is this: What are the dotnet equivilents of commands such as: Adodc1.Recordset.AddNew Adodc1.Recordset.Update Adodc1.Recordset.MoveFirst Adodc1.Recordset.MoveNext Adodc1.Recordset.Delete
1
4132
by: Murtaza | last post by:
Hi all Looking for assistance on an issue in Excel (2000 sp2 / pro) and access 2003. I have a database and in my VB code have created a ADODB.connection to it. It is called conn. I have used it for sqlPassThrough queries as follows: modfindSQL = "SELECT ....." Set modfindrs = conn.Execute(modfindSQL, , dbSQLPassThrough)
7
5991
by: michal | last post by:
hi guys, i am using postgres 8.2 and try to add some records to a table with ADODO ... unfortunately i end up with an error when calling the addNew() method. it says that the recordset does not support updating... i do open the connection the following set RS = server.createObject("scripting.dictionary") RS.open "usr", cn, 1, 3, 2
1
8444
Ali Rizwan
by: Ali Rizwan | last post by:
Hello every body I have a problem. When i want to add a record. and its sub record an error is occured. "Operation canceled" I have made an record with reg no of 3 and have to update its sub records like name, roll no, father name etc how can i do this.
2
2115
by: Kamil | last post by:
Hi. Is it possible to add new record to my recordset which is based on a query? I want to use this recordset only for temp starage of data, and I don't want to update values from this recordset to a table. Code: Q2 = "SELECT T_SMP_RCNR.KEY_ORDER, T_SMP_RCNR.RCNR, T_SMP_RCNR.KEY_RCNR " & _ "FROM T_SMP_RCNR LEFT JOIN Q_MaxOfSMPRCNR ON
0
9639
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
9479
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10311
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8967
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...
0
5378
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...
1
4043
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
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.