Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[VB6] Have a selection in a recordset. How do i easily del..

 
   Database Help (Home) -> Visual Basic RSS
Next:  Unrecognised database format  
Author Message
Zeppo

External


Since: Feb 19, 2005
Posts: 2



(Msg. 1) Posted: Sun Feb 20, 2005 12:15 am
Post subject: [VB6] Have a selection in a recordset. How do i easily delet
Archived from groups: comp>lang>basic>visual>database (more info?)

As said: my app lets users select records.
They can choose to delete the whole current selection.

i tried rs.delete, but that gave me an error.

Primary keys are in available in recordset.

Any thoughts?

 >> Stay informed about: [VB6] Have a selection in a recordset. How do i easily del.. 
Back to top
Login to vote
Zeppo

External


Since: Feb 19, 2005
Posts: 2



(Msg. 2) Posted: Sun Feb 20, 2005 12:15 am
Post subject: Re: [VB6] Have a selection in a recordset. How do i easily d [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sat, 19 Feb 2005 23:42:21 +0100, Zeppo
wrote:

 >As said: my app lets users select records.
 >They can choose to delete the whole current selection.
 >
 >i tried rs.delete, but that gave me an error.
 >
 >Primary keys are in available in recordset.
 >
 >Any thoughts?

to be precise: i get a lovely

"insufficient key column information for updating or refreshing"

error when trying to rs.delete<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: [VB6] Have a selection in a recordset. How do i easily del.. 
Back to top
Login to vote
Veign

External


Since: Apr 22, 2004
Posts: 13



(Msg. 3) Posted: Sun Feb 20, 2005 12:15 am
Post subject: Re: [VB6] Have a selection in a recordset. How do i easily d [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Post some code and SQL statements

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
<a style='text-decoration: underline;' href="http://www.veign.com/vrc_main.asp" target="_blank">http://www.veign.com/vrc_main.asp</a>
--

"Zeppo" wrote in message

 > On Sat, 19 Feb 2005 23:42:21 +0100, Zeppo

 >
  > >As said: my app lets users select records.
  > >They can choose to delete the whole current selection.
  > >
  > >i tried rs.delete, but that gave me an error.
  > >
  > >Primary keys are in available in recordset.
  > >
  > >Any thoughts?
 >
 > to be precise: i get a lovely
 >
 > "insufficient key column information for updating or refreshing"
 >
 > error when trying to rs.delete
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: [VB6] Have a selection in a recordset. How do i easily del.. 
Back to top
Login to vote
mickey

External


Since: Feb 15, 2005
Posts: 6



(Msg. 4) Posted: Sun Feb 20, 2005 7:40 am
Post subject: Re: [VB6] Have a selection in a recordset. How do i easily d [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Back to top
Login to vote
Zeppo1

External


Since: May 03, 2004
Posts: 4



(Msg. 5) Posted: Sun Feb 20, 2005 3:40 pm
Post subject: Re: [VB6] Have a selection in a recordset. How do i easily d [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sat, 19 Feb 2005 23:23:00 GMT, "Veign" wrote:

 >Post some code and SQL statements

Well, there is not much to show.
Basically, i filled an ado recordset with a sql query.
The recordset is shown in a datagrid.
Of course i could delete every record one by one, but i was looking
for a way to easily delete all records. As said: the primary key is
part of the recordset.
Rs,delete didn't work. Is there a way to delete all records in 1 SQL

Something like:

DELETE * FROM mytable WHERE id IN .......<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: [VB6] Have a selection in a recordset. How do i easily del.. 
Back to top
Login to vote
Randy Day

External


Since: Oct 06, 2003
Posts: 50



(Msg. 6) Posted: Sun Feb 20, 2005 8:49 pm
Post subject: Re: [VB6] Have a selection in a recordset. How do i easily d [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Zeppo wrote:


 >
 >
  >>Post some code and SQL statements
 >
 >
 > Well, there is not much to show.
 > Basically, i filled an ado recordset with a sql query.
 > The recordset is shown in a datagrid.
 > Of course i could delete every record one by one, but i was looking
 > for a way to easily delete all records. As said: the primary key is
 > part of the recordset.
 > Rs,delete didn't work. Is there a way to delete all records in 1 SQL
 >
 > Something like:
 >
 > DELETE * FROM mytable WHERE id IN .......

Use an ADODB.Command object.

<a style='text-decoration: underline;' href="http://juicystudio.com/tutorial/vb/database.asp" target="_blank">http://juicystudio.com/tutorial/vb/database.asp</a>

Look for the section entitled 'The SQL Delete Statement'<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: [VB6] Have a selection in a recordset. How do i easily del.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
How to do a SELECT on a RecordSet - How would I do a SELECT on a ADODB.RecordSet? I have created the recordset from an Oracle database using a Select statement with a Group By. Now I need to Select from that result and further Group By and Sum. The logic of the statements don't allow for....

Move to specific row in an ADODB.recordset - Hello! I would like to move to a specific row in a recordset. For example I would like to get the value "MyText" from the 100. row. A very slow approach would be dim l& for l = 1 to rs.recordcount if l = 100 then ... Is there a faster...

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...

arrays - is there a way to concatenate the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a datareport for example after 5 records printed. Thank you all
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]