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

[VB6 /ADO] Delete statement: Delete all underlying records..

 
   Database Help (Home) -> Visual Basic -> ADO RSS
Next:  Getting xp to recognize and intialize MODEM  
Author Message
Zeppo1

External


Since: May 03, 2004
Posts: 4



(Msg. 1) Posted: Sun Feb 20, 2005 3:40 pm
Post subject: [VB6 /ADO] Delete statement: Delete all underlying records f
Archived from groups: microsoft>public>vb>database>ado (more info?)

I couldn't figure this one out:
my app lets users select records, that are displayed in a datagrid
They can then choose to delete the whole current selection.

i tried rs.delete, but that gave me an error.
Primary keys are in available in recordset.
to be precise: i get a lovely
"insufficient key column information for updating or refreshing"
error when trying to rs.delete

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 .......

 >> Stay informed about: [VB6 /ADO] Delete statement: Delete all underlying records.. 
Back to top
Login to vote
Veign2

External


Since: Feb 04, 2004
Posts: 123



(Msg. 2) Posted: Mon Feb 21, 2005 11:29 am
Post subject: Re: [VB6 /ADO] Delete statement: Delete all underlying recor [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Answered in another newsgroup...

--
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" <zeppo_no_spam_at_all DeleteThis @xs4all.nl> wrote in message
news:ukph11hps1310g4e2qealmd170i6pjl1k1@4ax.com...
 > I couldn't figure this one out:
 > my app lets users select records, that are displayed in a datagrid
 > They can then choose to delete the whole current selection.
 >
 > i tried rs.delete, but that gave me an error.
 > Primary keys are in available in recordset.
 > to be precise: i get a lovely
 > "insufficient key column information for updating or refreshing"
 > error when trying to rs.delete
 >
 > 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 /ADO] Delete statement: Delete all underlying records.. 
Back to top
Login to vote
Stu

External


Since: Oct 28, 2003
Posts: 8



(Msg. 3) Posted: Thu Feb 24, 2005 3:33 pm
Post subject: Re: [VB6 /ADO] Delete statement: Delete all underlying records from current recordset. [multiposted] [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Which newsgroup? Is the answer just to use a loop to build a string of
prikeys then do delete from table where prikey in (STIRNG)? This will
eventually fail because the number of records selected increases the string
will become larger.

Cheers
Stu

"Veign" <NOSPAMinveign DeleteThis @veign.com> wrote in message
news:O8CBvqCGFHA.1044@TK2MSFTNGP14.phx.gbl...
> Answered in another newsgroup...
>
> --
> Chris Hanscom - Microsoft MVP (VB)
> Veign's Resource Center
> http://www.veign.com/vrc_main.asp
> --
>
> "Zeppo" <zeppo_no_spam_at_all DeleteThis @xs4all.nl> wrote in message
> news:ukph11hps1310g4e2qealmd170i6pjl1k1@4ax.com...
> > I couldn't figure this one out:
> > my app lets users select records, that are displayed in a datagrid
> > They can then choose to delete the whole current selection.
> >
> > i tried rs.delete, but that gave me an error.
> > Primary keys are in available in recordset.
> > to be precise: i get a lovely
> > "insufficient key column information for updating or refreshing"
> > error when trying to rs.delete
> >
> > 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 .......
>
>
 >> Stay informed about: [VB6 /ADO] Delete statement: Delete all underlying records.. 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> Visual Basic -> ADO 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 ]