Forum Discussion

tpoirier's avatar
tpoirier
Contributor
12 years ago

Return Values from ADO db query

I have the following query set up and am attempting to return values from it. The first two Config, and ModBy return fine, but the third Vers comes up blank. When I query the db directly it returns a value as expected. Any ideas? Vers is a timestamp value. 




  var query = "SELECT cv.ConfigurationValueId, cv.ModifiedBy, cv.Version FROM dbo.ConfigurationValue cv WITH (NOLOCK)"


              + "INNER JOIN dbo.Organization o WITH (NOLOCK)"


              + "ON o.OrganizationId = cv.OrganizationId " 


              + "WHERE cv.ConfigurationId = 'F4B4A119-63F1-4E95-8E12-4588978C1884'";


              + "AND o.StoreCode = '" + StoreNum + "'";


  


  Cmd = RICSconnection.Execute(query);


 


  Config = VarToStr(Cmd.Fields("ConfigurationValueId"));


  ModBy = VarToStr(Cmd.Fields("ModifiedBy"));


  Vers = VarToStr(Cmd.Fields("Version"));