• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

convert record to integer

In VB6 I have pulled up a recordset from a database.  The first record marked by rec.Fields(0) has a datatype which is a string.  How do I convert it to an integer?

If rec.Fields(0) = 5 Then
 'code goes here
End If
0
al4629740
Asked:
al4629740
1 Solution
 
dsackerContract ERP Admin/ConsultantCommented:
If you are absolutely sure it will always contain a numeric value, then:

If CInt(rec.Fields(0)) = 5 Then
    ' code goes here
End If
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now