kjack
kjack

Reputation: 2014

Changing integer to long

I have to change all integer variables to long variables in an application that has a VB6 front end and a jet MDB file backend.

I am planning to do this by

A. In the program

  1. changing all declarations from 'As Integer' to 'As Long' except for built-in paramters such as the 'Cancel as Integer' in the Unload event. and
  2. Changing all 'CInt' to 'CLng'

And

B. In the database

  1. deleting the indices
  2. adding a temporary integer column with same default value as the column to be replaced
  3. copying the data to these
  4. deleting the original column
  5. creating a new column with the name of the old column
  6. copying the data across again
  7. deleting the temporary column
  8. recreating the indices

Is this a feasible approach? Are there any gotchas?

Upvotes: 1

Views: 898

Answers (1)

Andy G
Andy G

Reputation: 19367

B. In the table design you can change the data-types/ Number from Integer to Long Integer. You are increasing the size, so this shouldn't be a problem. Copy the tables firstly if you are concerned.

Step A is okay, but you can't change the event argument Cancel. Well, you might be able to, but you shouldn't! It won't be necessary/relevant anyway. Don't change such arguments, or any other system (rather than custom) arguments without consideration.

Upvotes: 4

Related Questions