Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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