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.

 All Forums
 Other Forums
 MS Access
 CommandText does not run a result set

Author  Topic 

zhshqzyc
Posting 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 making
Aged 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.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-30 : 23:24:30
I'm confused as to what the subject has to do with update statement.

zhshqzyc, you're going to have to ask us a question in order for us to help.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

russell
Pyro-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?
Go to Top of Page

zhshqzyc
Posting 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
Go to Top of Page

russell
Pyro-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
Go to Top of Page

zhshqzyc
Posting Yak Master

240 Posts

Posted - 2010-03-31 : 10:05:21
Yes. You are right.
Go to Top of Page
   

- Advertisement -