Page 1 of 3 123 LastLast
Results 1 to 40 of 90

Thread: VB6 Compile Error

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    VB6 Compile Error

    When attempting to make an exe file I receive a compile error.

    Code:
    If datSetDisplay1.Recordset.EOF And datSetDisplay1.Recordset.BOF Then
        datSetDisplay1.Recordset.Close
        pbarReport.Value = 0
        rtbReports.Text = Chr(13) & "                                DATA ERROR:   LETTERARCHIVE TABLE EMPTY OR NOT FOUND."
        Exit Sub
    In the third line the ".Value = " is highlighted.

    This isn't my program but I'm trying to make a change to a form. This project built the source file and output files fine, but ran into this issue when attempting to make the exe file.

    If I tell the program to ignore this line, then the same issue appears further down the code.
    Please advise. Help is appreciated.
    Last edited by dday9; Jan 27th, 2022 at 03:22 PM. Reason: formatted code

  2. #2
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    What's the error message?

    What type of Control is pbarReport?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    It's a compile error: Method or data member not found.
    I'm not positive on the control but I think it's an OCX

  4. #4
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    That error means that the control name pbarReport doesn't have a .Value property.

    If you copy & pasted the code from somewhere, you will need to make sure that you add the correct type of control to the form (in this case, likely a ProgressBar control).

    If you downloaded the project from somewhere, then perhaps you don't have the control/OCX registered on your computer. In this case, you would have seen an error the first time you loaded the project and the missing control would have been replaced with a PictureBox control (which does not have a Value property).

    Can you post the entire project for examination? Or at least the .frm file?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    Thanks for the reply. I wish I could post the .frm files but there are 11 of them and they're all quite large. My guess is the OCX may not be registered on this desktop I'm working the program on since it's not the laptop the program normally runs on. I'll try registering the OCX and see if that helps. Thanks

  6. #6
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,083

    Re: VB6 Compile Error

    Well if the ocx was not registered properly VB would have most likely changed it to a picture box and if you save the file after this then that can be a can of worms.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    Quote Originally Posted by DataMiser View Post
    Well if the ocx was not registered properly VB would have most likely changed it to a picture box and if you save the file after this then that can be a can of worms.

    I was going to send you a copy of the Visual Basic Project, but this forum says "invalid file type". Other suggestion before I create a can of worms?

  8. #8
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    7,614

    Re: VB6 Compile Error

    Sounds like the application is looking for a ProgressBar. You can add it to the Toolbar from Project -> Components and selecting Common Controls:-

    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    Well, that was a nice try. I went in and added that component, but unfortunately received the same error and stop at the same place.

  10. #10
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    If you ZIP up the project, you should be able to post it.

    Though DataMiser is right - if you saved the project after it couldn't find the reference, then you likely have saved it with a bunch of auto-converted PictureBoxes instead of the proper controls. Do you have an original unopened copy hanging around? If so, please zip & upload that one.

  11. #11
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    7,614

    Re: VB6 Compile Error

    Quote Originally Posted by fpojre View Post
    Well, that was a nice try. I went in and added that component, but unfortunately received the same error and stop at the same place.
    Like others have said, the missing controls were probably replaced with PictureBoxes by the IDE. This tends to happen when loading a project and the OCX cannot be resolved by the IDE due to not being added to the project or some kind of error with registration. It is probably best you upload the original project as jpbro suggested.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    I have attached a copy of the project. All we are attempting to do is change one form (frmEvalScreen.frm) to reflect new dates. Not sure why we're getting this error.
    I attemted to upload the entire application, but it wouldn't upload, I guess it's too large. If you think it would help, I can try added it to dropbox and sending a link.
    Attached Images Attached Images  
    Attached Files Attached Files

  13. #13
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    Can you upload frmEvalScreen.frm?

  14. #14
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,083

    Re: VB6 Compile Error

    Yeah the frm file would be of help. The vbp doesn't tell us much.

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    if you unzip the project. All the forms are there. That's why I sent the whole project. When you ask for the object on the eval form you'll see the changes that were in the jpeg I sent. If for some reason you can't get the forms to come up after you unzip the project, let me know and I'll try another method.

  16. #16
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    The ZIP only contains CRANETRACKER68.vbp, no other files. The file of interest is frmEvalScreen.frm.

  17. #17
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    1,974

    Re: VB6 Compile Error

    Quote Originally Posted by fpojre View Post
    if you unzip the project. All the forms are there. That's why I sent the whole project. When you ask for the object on the eval form you'll see the changes that were in the jpeg I sent. If for some reason you can't get the forms to come up after you unzip the project, let me know and I'll try another method.
    As has been mentioned above, and possibly missed by you or ignored, the issue almost certainly is that the project references controls from .ocx files that were present on the machine initially used to build this project, but not present on the machine you are using to try to build this project. When that happens, Visual Basic replaces references to those controls with a PictureBox.

    Rather than relying on us to confirm this for you, there are two suggestions you can do:

    1. Open the frmEvalScreen.frm in Notepad. At the top of this file will be a listing of all controls present on the form. Search for pbarReport and it will bring you to the part of the file where the specifics of that control are defined. It will likely be on a line that says something like "Begin VB.PictureBox pbarReport", which will confirm what others have said.

    Or

    2. In the Form_Load event for the frmEvalScreen, add this as the first line of code:

    Code:
    MsgBox TypeName(pbarReport)
    Run the program (don't compile, just run), do whatever it takes for the frmEvalScreen form to load, and you will almost certainly get a pop-up message that says "PictureBox"

    If so, this will confirm what others have mentioned, and means that the first thing you will need to do is determine what .ocx files are being used by this program, get copies of them, and get them properly "installed" on the device that you are using to build this program.

    Good luck.

  18. #18

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    I've zipped and attached 5 of the 7 forms. 5 is the max on a post. I'll reply with the other 2.
    Attached Images Attached Images  
    Attached Files Attached Files

  19. #19

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    I've attached the last to log reports.
    Attached Files Attached Files

  20. #20
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    You didn't attach the forms, but the error logs. Good thing is that those are useful too

    Here are your problem/missing libraries:

    Code:
    MSComctlLib.ProgressBar 
    RichTextLib.RichTextBox
    Those are strange libraries to be missing as AFAIK they get installed when you install VB6.

    Do you have the following files in C:\Windows\SysWow64:

    Code:
    richtxt32.ocx
    mscomctl.ocx
    ?

  21. #21

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    Ok, we're 2 for 4. The 2 ocx files are where they should be in SysWow64. However the 2 LIB files are (as you stated) not in the available references or components to add. I'm not that familiar with VB6 so where can I find these and how do I add them to the library?

  22. #22
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    Copying the OCXs isn't enough, you will also have to register them from an elevated command prompt. e.g.:

    Code:
    c:\windows\syswow64\regsvr32.exe c:\windows\syswow64\mscomctl.ocx
    c:\windows\syswow64\regsvr32.exe c:\windows\syswow64\richtx32.ocx
    Microsoft Rich TextBox Control and Microsoft Windows Common Controls 6.0 should then appear in your Components list (make sure to restart VB6 if you had it open when registering the OCXs).

  23. #23

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    No, I didn't copy them. They were already in the folders. How about the 2 missing libraries? Where do I find those and install them?

  24. #24
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    The ProgressBar control is part of MSComctlLib which can be found in the c:\windows\syswow64\mscomctl.ocx OCX file.

    The RichTextBox control is part of RichTextLib which can be found in the c:\windows\syswow64\richtx32.ocx OCX file.

    If you already have c:\windows\syswow64\mscomctl.ocx and c:\windows\syswow64\richtx32.ocx on your computer, then the errors you are getting in your logs imply that those 2 OCXs are unregsitered. You should try registering them from an elevated command prompt, then see if errors go away when you re-open your project.

    Note though that the project on your computer is likely now corrupt (e.g. the RichTextBoxes and ProgressBars have been converted to PictureBoxes). This means you will first need to restore all of the project source files from "the laptop the program normally runs on" (where it still works) then try re-opening it after registering the OCX files.

  25. #25

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    so I have the ocx files registered now. I attempted to make the exe again and got this error: Compile error - Method or data not found. rtbGenReport.Text = "" and .Text = is highlighted.
    I have not restored all the files as of yet. I was trying with the old project. Is that why I'm receiving this error because of the conversion to PictureBoxes in the old project?

  26. #26

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    I've attached the error.
    Attached Images Attached Images  

  27. #27
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    Yes that is why you are seeing this error. You must restore the old/working project source files now that everything is (hopefully) properly registered.

  28. #28

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    ok, it will be tomorrow or maybe Monday before I can do that, but I will and get back to you and let you know the results. Appreciate your help.

  29. #29
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,083

    Re: VB6 Compile Error

    It sounds like VB6 was not properly installed on the system, could be other issues waiting to show themselves at any moment.

  30. #30

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    Ok, I'm having a problem. I deleted the folder with all the old files. I've copied the program over (the .exe) but it won't load into VB6 as an .exe and I deleted the old db projects. As I previously stated I'm not that familiar with VB6 so I'm not sure how to get this loaded and make the changes again so we can proceed. Appreciate your help.

  31. #31
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    The .EXE is the compiled from the VB6 source code - there's no way to convert the compiled EXE back to VB6 source code.

    You need to locate and use the original copy of the VB6 source code and project files. These will be files with extensions like .VBP, .VBG, .CLS, .FRM, .FRX, .BAS, .CTL, .CTX. Based on your earlier subsmissions, you will have files like frmSearchByAirport.frm, frmData.frm, frmQA.frm, etc...

    You must get these files from the last computer (or backup) where the program was working so that you aren't trying to work with a version that was broken by your missing-reference controls being converted to PictureBoxes.

  32. #32

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    Ok, I've found a VBP and I ran the exe and got a compile error -Can't find project or library.
    INVERSE_LENGTH = Trim (Str$) (CDb1 (J27)))
    Reference Library comes up showing MISSING: Microsoft Excel 8.0 Object Library
    I've unchecked that block, but have stopped at this point. I haven't attempted a re-run yet. Waiting to hear what you say.

  33. #33
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    7,614

    Re: VB6 Compile Error

    Quote Originally Posted by fpojre View Post
    Reference Library comes up showing MISSING: Microsoft Excel 8.0 Object Library
    I think you need to install MS Office for this library to be installed.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  34. #34

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    Ok, this is another strange occurrence and why I stopped exactly where I did without unchecking that block. MSOffice is already installed on this machine and all the apps, including Excel are working fine. That's why I'm not sure why I got this error message. Ideas?

  35. #35
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,114

    Re: VB6 Compile Error

    You probably have a newer version of Excel installed. You will either need to install the 8.0 version, or remove the old reference and add a reference to the current version that is installed on your computer.

  36. #36
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    1,974

    Re: VB6 Compile Error

    Quote Originally Posted by fpojre View Post
    Ok, this is another strange occurrence and why I stopped exactly where I did without unchecking that block. MSOffice is already installed on this machine and all the apps, including Excel are working fine. That's why I'm not sure why I got this error message. Ideas?
    The Excel 8.0 Library = Office 97. Presumably the version of Office on the machine you are currently using is much newer than that.

  37. #37

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    yes, I currently have MSOffice 365. I'll try and find Office 97 and see if I can get it to install.

  38. #38

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    yes, I currently have MSOffice 365. I'll try and find Office 97 and see if I can get it to install.

  39. #39
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    1,974

    Re: VB6 Compile Error

    Are you using Windows 10? If so, I would strongly recommend ceasing any attempt to get this all working inside of Windows 10. Instead, I would recommend downloading something like VirtualBox, getting a virtual Windows XP machine up and running, install VB 6.0 inside that VM along with Office 97 and any other potential dependencies. Because it sounds like the old development laptop that was used in the past is potentially running a lot of old software, and trying to get all of it working inside of Windows 10 is probably going to end up unsuccessful, or, at the very least, more tedious and complicated than just getting it working in an XP VM.

    Good luck.

  40. #40

    Thread Starter
    Lively Member
    Join Date
    Jan 2022
    Posts
    76

    Re: VB6 Compile Error

    No, this is a WIN7 machine. I have to keep this one running on WIN7 because of older programs I need such as Access97

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width