Question

  Asked: May 2 2008   10:43 AM GMT
  Asked by: Shwetha


how can i limit the data size while entering to the database ?


VB6, Visual Basic, Microsoft Excel

how can i limit the data size while entering to the database from Excel sheet using vb6?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



For strings being placed into the database, you can use the Mid() function to get only a certain portion of a string. And you could use a series of if greater than (>) or less than (<) statements to limit the size of a number in a If elseif statement.

If you're not doing some client side data validation the real challenge you have is, "What to do with the left overs". For example, this string is being placed into a field but I only want the first 10 characters:
Now is the time for all men to come to the aid of their fellow countrymen.

Which, of course, becomes:
Now is the

But what do you do with this part:
time for all men to come to the aid of their fellow countrymen.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development and Microsoft Windows.

Looking for relevant Development Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register