PDA

Click to See Complete Forum and Search --> : delete function in stored procedure


jas_alien2
Sep 24th, 2000, 10:01 PM
can any one show me an example of delete function using stored procedure??

Sep 25th, 2000, 11:43 AM
Do you mean Delete statement?

delete from tablename where col1 = "ABC"

jas_alien2
Sep 25th, 2000, 08:28 PM
nope not that one, i mean calling a stored procedure which deletes a certain record, pls help.. thanks

Sep 26th, 2000, 10:42 AM
First, Stored procedure to delete a row:

create procedure Procname
@colval varchar(10) as
delete from tablename where col1 = @colval


To execute the stored proc from your VB code:

dim conn as ADODB.Connection
Set conn = New ADODB.Connection
conn.ConnectionString = strConnectString ' specify your connect string

conn.Open

conn.execute "Procname 'ABC'",,adcmdStoredProc + adExecuteNoRecords

Hope this helps.