vb 6 sql through odbc
===

 

Dim Ssql
Dim dbstatus 
Dim rs

'*************       
     
     Ssql =  " Select * from User_Access A Where A.User_pwd ='1234' "
      set rs = Server.CreateObject("ADODB.RecordSet")
      rs = DB.execute(Ssql,dbstatus)      
      Response.Write(dbstatus)
      If dbstatus <> 0 Then
            'Error code here
      Else
            'code here 
      END IF
      
     
'*************

The code is working ok . On successful execution of sql statement the dbstatus value is giving -1 . But according to the code it should return 0 for further execution . For other than 0 it will give Error .

I'm executing this on sql server 2005 and in windows 7. 

***But the same code On successful execution of sql statement the dbstatus value is giving 0 on some other enviornment where ODBC version and sql server version is different .

Can anyone help me out . 
Thanks in advance