Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Firefly17
Yak Posting Veteran
78 Posts |
Posted - 2005-09-11 : 23:52:17
|
| HiHow can I know whether a query or a stored procedure is successfully executed? I mean like in delete case? here is an examplesql_delete = "DELETE FROM UserData where U_ID='" & tempID & "'"rstIDChk.Open sql_delete, cnn, adOpenStatic, adLockOptimisticHow can I make sure that the record is deleted so that I can proceed with other jobs? How can I catch it in the program like from VB? Is there any return like true or false in SQL? :(Tks alot.. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-12 : 00:37:44
|
| After executing that statement execute rstIDChk.Open "Select @@RowCount", cnn, adOpenStatic, adLockOptimisticif rstIDChk.fields(0)>0 then--Some records were deletedend ifMadhivananFailing to plan is Planning to fail |
 |
|
|
Firefly17
Yak Posting Veteran
78 Posts |
Posted - 2005-09-12 : 01:43:26
|
| Hi tks alot but I still have some questions.. how abt if I want to tell the user that the table is using by someone else at pt of accessing that table.. like hererstTran.Open "Tran", cnnReLoss, adOpenStatic, adLockOptimisticI opened the record set with lock.. so, if one user is using it, the other can't modify ( am I right? If I were wrong, pls correct me :( ).. I used to get message like table is used by other prg or sth like that. But I have to tell the user with a userfriendly message and quit that routine. How can I do it? How can i know if someone is using that table at that opening state? |
 |
|
|
|
|
|