473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Procedure Size

Can any one help me to find out the size of a Procedure, as my code is currently over the 64k limit
Dec 5 '06 #1
7 2081
sashi
1,754 Expert 1GB
Can any one help me to find out the size of a Procedure, as my code is currently over the 64k limit
Hi there,

Am not sure what you meant by "Procedure Size"? No. of words? Which one?Please be clear & simple when asking question as it would ease in providing solution in return. Take care.
Dec 5 '06 #2
I have a Compile Error stating "Procedure Too Large" - I am unsure on how to deal with this and how to find out the actual size
Dec 5 '06 #3
sashi
1,754 Expert 1GB
I have a Compile Error stating "Procedure Too Large" - I am unsure on how to deal with this and how to find out the actual size
Hi there,

This a common problem in VB 6.0 as it doesn't support any procedure above 64K limit. The best approach to deal with this error is to breakdown the procedure into smaller parts, hope it helps. Good luck & Take care.
Dec 5 '06 #4
This is crazy!

You mean to tell me my head can hold more stuff on the fly than my PC can compile?

I have VB Pro 5 and how I am supposed to stop programming, take it apart and put it together in smaller bits, then proceed in any useful manner without just giving up is beyond me...

Is there any patch or fix for this whatsoever?
Sep 10 '07 #5
Anyone else reads this, here's what I did.

Firstly, the message is full of Microsoft's usual **** (pick a four-lettered word). The program will compile will no errors and run without trouble. Why do I feel this 64Kb limit is really not necessary and that 'you only have version 5' is about the best excuse I'm going to hear (when version 5 came out my PC had 640Mb of RAM - that's a lot of procedures I'd have to write). My advice - ignore the error and compile to HDD.

Secondly, even if you reduce said procedure to dozens of lines less than before, you may find you still get this message. (I checked VB's definition of 'a procedure' - it seems that I am right that the primary subroutine is just this) Indeed, after creating another form, removing all reference to the new stuff and cleaning some old code out, I still got the message (and yes, it still compiles and runs if you just try compiling to HDD and testing it from there). My advice - don't hurt your code!
Sep 10 '07 #6
Killer42
8,435 Expert 8TB
I'd be curious to know exactly what it was in your code that caused this error. But generally speaking, "reduce the procedure size" is good advice. If it's too big to compile, it's probably too big to make sense of. Break the code into logical chunks. In other words, take out logical chunks of the code and make them Subs or Functions.

It could also mean you are allocating too much memory at the wrong scope. For example, creating a huge array inside a routine.

And yes, probably "upgrade to VB 2005" would be the best advice. VB 2005 Express Edition is available as a free download. I'm sure many limitations will have been addressed by now. (There's also a VB 2008 beta, but I don't know anything about it.)
Sep 10 '07 #7
I'd be curious to know exactly what it was in your code that caused this error. But generally speaking, "reduce the procedure size" is good advice. If it's too big to compile, it's probably too big to make sense of. Break the code into logical chunks. In other words, take out logical chunks of the code and make them Subs or Functions.

It could also mean you are allocating too much memory at the wrong scope. For example, creating a huge array inside a routine.

And yes, probably "upgrade to VB 2005" would be the best advice. VB 2005 Express Edition is available as a free download. I'm sure many limitations will have been addressed by now. (There's also a VB 2008 beta, but I don't know anything about it.)
As far as procedure too big to compile, I would like to know how come VB5 Pro can seem to compile past this error to an .exe outside of the program, which then runs with no errors.

While we're at it, on the point of can I handle a procedure of 64Kb or more... When I did get around to compiling to the .exe - no errors were found. Seems I am quite up to the job (64Kb is hardly a great deal if you keep it tidy and methodical, my calculator used to have half this on it).

So then we get to your point on huge arrays - this is far more likely. I use arrays to hold data in storage so I can manipulate it later. It has worked fine so far too. At present I am passing these from procedure to procedure instead. The arrays are set to a size of 8x10001 cells and 5x10001 cells (double and string respectively). The way I understand computers, system RAM is about the only *convenient* limiting factor (I say this as it would only spill into virtual memory if this filled anyway - and I'd allocate a dedicated 10Gb swap partition if this were the case - it is what I do in Linux and I know from my work it works well in NTFS setups too.

Brings me to the last point - can't see why 64Kb. 640Kb and I'd be far less surprised (that old conventional memory rubbish - thanks, Mr. Gates).

Thanks for your help anyway - I think I'll go get VB 2005 and give it a spin.

Happy coding :)
Sep 11 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Robin Tucker | last post by:
As I had real problems working my head around sp_spaceused, I've written an SP to do it (I also noted a lot of questions about this when "searching"). Pass in a database name and it will return the...
4
by: Mullin Yu | last post by:
i have a stored procedure at sql server 2k. which will update records and select result from temp table. if i use SqlConnection class, and i do both. but, if i use OleDbConnection class, i can...
1
by: Hugo Lefevre | last post by:
Dear, I have a problem : I have a database which contains my data of hardware. The Id is a varchar and I want at my filling form that my user know which is the last one. So I made a store...
2
by: Yoshitha | last post by:
hi all i created a stored procedure like this which retruns values am not sure whether it is correct or not. if it is wrong can you tell me where i did mistake. CREATE PROCEDURE...
6
by: SandySears | last post by:
I am trying to use a stored procedure to insert a record using VS 2005, VB and SQL Server Express. The code runs without errors or exceptions, and returns the new identifer in the output...
4
by: hicks | last post by:
I'm trying to invoke a DB2 stored procedure. The stored proc is coded in C and compiled to a shared library, which has been placed in the <DB2 dir>/functions directory. The platform is Solaris....
6
by: Ronchese | last post by:
Hello, is there any way to get the name of the current running procedure? For example: Public Sub Test( ) 'do something '...
0
by: Big George | last post by:
Hello, I'm trying to save a jpg file of 300KB as a BLOB field in an Oracle 10g Database. If I try to call a Stored Procedure, it fails. If I use CommandText with SQL sentence, it success. I...
1
by: C#_Beginner | last post by:
I was wondering if someone can help me out. I'm getting the following error: Message: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2'...
5
by: Dennis | last post by:
Hi I'm trying to alter my stored procedure to take a parameter for the Database Name, but as usual the syntax is killing me. Thanks for any help Dennis ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.