473,471 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to delete a record from database using Data tool not the ADODC-vb6

5 New Member
hello there!

I would like to know how to delete a record from database with the use "Data" tool and not the ADODC which are usually used by many vb programmers.


Expand|Select|Wrap|Line Numbers
  1. private sub cmddelete_Click()
  2.  
  3. data1.recordset.delete
  4. data1.refresh
  5.  
  6. end sub
  7.  
When I use the above code,the program suddenly terminates after I click the delete button. The code should delete the current record and not to terminate/close the program.

I cant find what is the problem with these one. Please help me.
Sep 20 '12 #1
1 3118
Killer42
8,435 Recognized Expert Expert
Perhaps the refresh is the problem, since there's no current record there now? I'd suggest you try ReQuery (if supported) or maybe MoveNext.
Sep 22 '12 #2

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

Similar topics

3
by: Uwe Range | last post by:
Hi to all, I am displaying a list of records in a subform which is embedded in a popup main form (in order to ensure that users close the form when leaving it). It seems to be impossible to...
2
by: Bassem | last post by:
Hi all... I searhed for a code to save and retrieve image from SQL database using Data adapter but I didn't found anything. Thanks, Bassem.
1
by: pmud | last post by:
I need an editable datagrid. But for editing a datagrid as shown in the walkthrough: Using a DataGrid Web Control to Read and Write Data, the table in the SQL database should have a primary key....
9
by: Peter | last post by:
Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the...
0
by: Abhi | last post by:
Hi, I have to connect to Oracle 10g Database using Data Access Application block code i am using is Connection string is contained in a file called orcle.config and it contains ...
0
by: jackvel | last post by:
Hi Dudes... I want to connect the Access database with VB 6.0 without using DataControl and ADODC.. Which option should i use.? Plz send me the detailed procedure of doing the same.. Plz...
0
by: nuray | last post by:
I have a spreadsheet where I run a query in Access and copy it into the specific spreadsheets. I was trying to use Data->import external data->import data tool in excel to get the data automaticly...
0
by: Rote Rote | last post by:
Hi Guys, I have a simple Edit,Update Gridview and i'm using ObjectDatasource with dataset generated and TableAdapters I can do an update no problem. But can't get my delete to work. When i look at...
2
by: mfaisalwarraich | last post by:
hi everybody, im new to vb.net and have googled around for moving to next record. i connected a MS Access Database using data source in Visual Studio 2008. im using the following code. ...
6
by: puneetmca | last post by:
I am using Windows XP as my OS and apache server. I have successfully inserted new records into database using forms and now want to delete the records from the database through using radio buttons....
0
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,...
0
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...
1
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
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,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.