run time error 731 application defined or object oriented error-VBForums
Results 1 to 12 of 12

Thread: run time error 731 application defined or object oriented error

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2017
    Posts
    7

    run time error 731 application defined or object oriented error

    Hi guys, im relatively experienced in vb6 but this time im really stuck i a very petty issue. I developed a complete vb6 app and it works well mostly. i generated its setup using the setup factory vb6 setup generation tool and package and deplyment wizard both. but in some win 8 and 7 pcs i get the runtime error 731 application defined or object oriented error. i tried a number of regular measures which include
    1) including vb6, vb5 runtime in setup
    2) installing mdac and odbc drivers
    3) manually copying and registering following dlls
    msdbrptr.dll
    msstdfmt.dll
    msado.tlb

    but none of it seems to work..pls guide on what to do next.. ill also try to attach a link of the setup to try
    regards

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    11,544

    Re: run time error 731 application defined or object oriented error

    If it is written in VB6 then you have no need for VB5 runtime. That is used only by VB5
    VB6 runtime is already on Windows 7 and 8 so should not be included with your setup.
    MDAC should not be included either.

    If anything those measures you have taken would cause problems rather than fix it

    The first thing you should do is determine where the error is being generated and what is generating the error.
    One method of doing this is by adding logging to suspect routines and then review the log to see what is there.
    Ideally use a utility that adds line numbers to your code and in your error handlers either log the ERL or show it in a msgbox

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2017
    Posts
    7

    Re: run time error 731 application defined or object oriented error

    Quote Originally Posted by DataMiser View Post
    If it is written in VB6 then you have no need for VB5 runtime. That is used only by VB5
    VB6 runtime is already on Windows 7 and 8 so should not be included with your setup.
    MDAC should not be included either.

    If anything those measures you have taken would cause problems rather than fix it

    The first thing you should do is determine where the error is being generated and what is generating the error.
    One method of doing this is by adding logging to suspect routines and then review the log to see what is there.
    Ideally use a utility that adds line numbers to your code and in your error handlers either log the ERL or show it in a msgbox
    Thanks for the answer first of all. Yes i did know the above files weren't essential but those were just desperate measures the error comes where the database connection is made. It uses APP.PATH to refer to it, and i read in some post that app.path has issues in win 7 and 8. So tried editing it but that doesnt help too

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2017
    Posts
    7

    Re: run time error 731 application defined or object oriented error


  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    11,544

    Re: run time error 731 application defined or object oriented error

    app.path does not have any issues really.

    The issue that comes up when using App.Path on Vista and later is that App.Path is usually the program files folder or program files(x86)

    Those folders are write protected so you can not use them as a storage location for your database or other files you require write access too.

    I have one old program that uses app.path. I altered the installer to install to a different location and all works fine.
    Of course this is not the recommended method but it will work.

    To see if you are being bitten by the security features of the OS you could temporarily disable UAC and see if your error goes away. If it does then it is the path of your data that is the culprit.
    You could also try running your app as admin and see if it works under that condition

    You should be placing the database under the application data folder
    https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx

    Or on a shared network drive or where ever makes sense but never in program files

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2017
    Posts
    7

    Re: run time error 731 application defined or object oriented error

    do you have any win of these windows ? can you pls give it a try once? the error comes just after the splash screen when you select any of the database type..

  7. #7
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    11,544

    Re: run time error 731 application defined or object oriented error

    Yes I have all recent versions of Windows but no I will not download and install unknown software to any of them. Sorry.

    I think you should be able to correct your issues based on what I posted in post #5

  8. #8

    Thread Starter
    New Member
    Join Date
    Feb 2017
    Posts
    7

    Re: run time error 731 application defined or object oriented error

    hi.. tried the above suggestion but not much clue. just another imp finding is that it runs well on my lappy having visual studio installed with win 10. thhis makes me think its related to some dll/ dependency only..

  9. #9
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    11,544

    Re: run time error 731 application defined or object oriented error

    I have Visual studio installed on all of my PCs so if that be the case would not help even if I did try it.

    Can you show the code where you make the connection and point out the line where the error occurs?

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    22,371

    Re: run time error 731 application defined or object oriented error

    did you actually try changing the location of the database? as suggested
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  11. #11

    Thread Starter
    New Member
    Join Date
    Feb 2017
    Posts
    7

    Re: run time error 731 application defined or object oriented error

    yes i did that already.. doesnt fix the issue. also i noticed that it does run in one of my pc's with windows 10 which has visual studio 6 installed along with other dev environments.. so again seems more of some dependency based issue.. what say?

  12. #12
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    11,544

    Re: run time error 731 application defined or object oriented error

    Is it installed in the same location using the same installer on that PC where it works?

    Quite often on a dev pc the files will not be in the program files tree and will work fine.

    What database are you using?

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.