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 rel="nofollow" style='text-decoration: none;' href="http://www.veign.com/vrc_main.asp" target="_blank">http://www.veign.com/vrc_main.asp</a>
--

"Zeppo" wrote in message

 > 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
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" wrote in message

> Answered in another newsgroup...
>
> --
> Chris Hanscom - Microsoft MVP (VB)
> Veign's Resource Center
> http://www.veign.com/vrc_main.asp
> --
>
> "Zeppo" wrote in message
>
> > 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:   
Related Topics:
VB SQL Statement Error - I am trying to run a SQL statement from a VB application and am receiving an error message. However, when I run a similar statement from Access using a query, I do not get the message and it executes successfully. The message received indicates that..

runtime error 3021 and user permissions - I have a VB6 application that uses ADO 2.7 to access an Access2000 database. I have found on Windows XP and 2000, that if the user is not part of the administrators group, they receive: "runtime error 3021. Either BOF or EOF is true, or the current ...

updatable ado-recordset - Hi, In the code below i have an updatable ado-recordset. However it is not working how i thought it would be. Maybe someone can help me out here? The global connection (Thanks to Brendan): Option Compare Database Option Explicit Public mconn As..

ADO Connection Access Database VB - I have been accessing a database on a local drive thru an ADO connection. The following is the code that I have been using. cnCejco.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Y:\Cejco.mdb;Persist Security Info=False" The problem is n...

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 -> ADO All times are: Pacific Time (US & Canada)
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 ]