Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 7 data type vs. VB 6 data type

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
I'm sure some of you experts can help me with this one :

My SQL Server 7 table contains COLx defined as type int, size=4

Using Enterprise Manager, I am able to 'manually' key-in values as large as 8888888 or so into COLx.....and SQL Server/Enterprise Manager stores the value, no error.

My problem is that the VB program gives an "Overflow Error"
when it reads COLx if it's value exceeds 32767 (32 K)

I need to store and process values at least as large as
99999.

QUESTIONS:
- Is there any way I can store values that exceed
32767 without converting my table, using a different dataType?

- Why the inconsistency/incompatability between VB data types and SQL Server 7 data Types?


Thanks for you suggestions.
John
 
The length of the datatype is whats important. an int in SQL Server has a length of 4, as you stated. Thats 4 bytes, which makes it a long in VB. You must be using a VB integer data type, which is 2 bytes. Use a Long datatype instead and you can go into the millions. Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
 
They increased the size of an int for SQL Server 7 -- I forget how big you can make them, but it's bigger than a regular int can hold in VB6

In VB6, just make your data type of type long for anything you are trying to take out of that field.

That should clear it up.

:)

ps -- I think they are making the same changes for .net, but don't **quote** me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top