how to update the table using update store procedure from the adp form.

I

itimilsina

when the user click the button on the form i would like to update the
tables with the same values. Like

Update Jobs
set JobNuber=JobNumber

for 7 different tables in our database, sql 2000. I could do this with
the sql store procedure but not sure how can i do within the adp form.
As i donot want sql store procedure which i can call from click event.

Could any one please let me know how can i write store procedure to
update data form the vb in adp form.

Thanks.

Indra.
 
M

Malcolm Cook

Indra,

I have a little trouble understanding your English.

Maybe this example will help.

It uses the example Northwind ADP. It creates a command button on the
[Orders] form which increases bye one the number of each item on the
current.

It depends on the fact that you can call a server stored procedure as though
it were a method of Application.CurrentProject.AccessConnection.

Here is the SQL Server procedure:
CREATE PROCEDURE dbo.p_IncrementQuantityForOrder (@OrderID int) --
increment by one the quantity in each 'Order Details' row for an order
determined by <@OrderID>

AS UPDATE dbo.[Order Details]

SET Quantity = 1 + Quantity

WHERE (OrderID = @OrderID)

Here is the Click event handler of a button placed on the Orders form .

Private Sub cboIncrementQuantityForOrder_Click()
'increment the quantity for each [Order Detail] item, and refresh the
display.
Application.CurrentProject.AccessConnection.p_IncrementQuantityForOrder
OrderID ' call the SQL Server stored proc.
Me.Orders_Subform.Form.Recalc ' update the display
End Sub

I hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top