| 
                
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 |  
                                    | zhshqzycPosting Yak  Master
 
 
                                        240 Posts | 
                                            
                                            |  Posted - 2010-03-30 : 18:06:51 
 |  
                                            | Can you look at the script? update ASSIGNMENT SET STAT=2 WHERE RGST = 1 and STAT_CD = 2 AND STAT1=4 Thanks. |  |  
                                    | DBA in the makingAged Yak Warrior
 
 
                                    638 Posts | 
                                        
                                          |  Posted - 2010-03-30 : 18:14:28 
 |  
                                          | Is that a trick question?There are 10 types of people in the world, those that understand binary, and those that don't. |  
                                          |  |  |  
                                    | tkizerAlmighty SQL Goddess
 
 
                                    38200 Posts |  |  
                                    | russellPyro-ma-ni-yak
 
 
                                    5072 Posts | 
                                        
                                          |  Posted - 2010-03-31 : 00:07:50 
 |  
                                          | UPDATE statements don't generate result sets.But Tara is right...is there a question here? |  
                                          |  |  |  
                                    | zhshqzycPosting Yak  Master
 
 
                                    240 Posts | 
                                        
                                          |  Posted - 2010-03-31 : 09:31:09 
 |  
                                          | If Not mobjContextMgr Is Nothing Then        The question is when the vb6 codes run the query, an error arise.UPDATE statements don't generate result sets.Should I ignore the error?Thanks LREG = mobjContext.CreateComponent(TERMINAL, CTX_NO_CREATE_IF_EXISTS).RegisterID        If LREG > 0 Then            nresult = mobjTillAssignSet.ExecDirect("update TILL_ASSIGNMENT SET STAT=2 WHERE RGST_ID = " & LREG & " and CM_STAT_CD = 2 AND STAT=4 ")        End If    End If |  
                                          |  |  |  
                                    | russellPyro-ma-ni-yak
 
 
                                    5072 Posts | 
                                        
                                          |  Posted - 2010-03-31 : 09:47:26 
 |  
                                          | I don't know anything about the component you're using, but surely it has a method to execute a query or stored proc without returning a result set.You're trying to assign a result to "nresult" but none is generated. Seems you're calling the wrong method.That said, if the update succeeds, you can safely ignore the error, but the problem with that is if a REAL error is generated, you won't know.I would guess however, that the error isn't occurring in the code snippet you showed, but more likely later in the code you're trying to use nresult |  
                                          |  |  |  
                                    | zhshqzycPosting Yak  Master
 
 
                                    240 Posts | 
                                        
                                          |  Posted - 2010-03-31 : 10:05:21 
 |  
                                          | Yes. You are right. |  
                                          |  |  |  
                                |  |  |  |  |  |