Results 1 to 11 of 11

Thread: Distribuation Problems With DataEnvironment

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    26

    Distribuation Problems With DataEnvironment

    Hi All,
    we've been kind of lazy and tried using the DataEnvironment. It works well on our machines with VB6 (and VS2005) on, but when we push it out to the users it doesnt work.

    Now I've been reading from past threads that our best plan is to go back and do ADO record sets as per our MO, and so that is the plan long term, however, our users need to try this before the holidays.

    So the question is; is there something that the dataenvironment needs that is not packed into the DLL by default? And if so, then what is it, and can we force it to be packaged, or install it some other way on machines that dont have VB?

    Many thanks for any and all help. Please don't slap us too hard for being so lazy in the first place

    Take care, and happy holidays,
    Craig

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Distribuation Problems With DataEnvironment

    What's the error? It could be a number of things....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    26

    Re: Distribuation Problems With DataEnvironment

    Quote Originally Posted by techgnome
    What's the error? It could be a number of things....

    -tg
    Hi tg,
    basically it is not connecting to the MDB at all. err.description is "Application-defined or object defined-error"

    Code:
    Private Sub Form_Load()
    
        On Error GoTo errhandler:
    
        Empty_ValuesTable
        Load_Primary_Nodes
        Load_Secondary_Nodes
        Load_Tertiary_Nodes
        Load_Quaternary_Nodes
    
        
    errhandler:
        If Err.Number <> 0 Then
            MsgBox "An error has occurred in Form_load - " & Err.Description
        End If
    
    End Sub
    Empty_ValuesTable is not deleting rows on machines without VB, installed, this all works great on machines with VB on.

    Code:
    Public Function Empty_ValuesTable()
        With DataEnvironment1
            If .rsGetAllChangedValueRecs.State = adStateOpen Then
                .rsGetAllChangedValueRecs.Close
            End If
            'Empty out the Changed_Values table
            .GetAllChangedValueRecs
            If .rsGetAllChangedValueRecs.RecordCount > 0 Then
                .rsGetAllChangedValueRecs.MoveFirst
                Do While Not .rsGetAllChangedValueRecs.EOF
                    .rsGetAllChangedValueRecs.Delete
                    .rsGetAllChangedValueRecs.MoveNext
                Loop
                '.rsGetAllChangedValueRecs.Update
            End If
            If .rsGetAllChangedValueRecs.State = adStateOpen Then
                .rsGetAllChangedValueRecs.Close
            End If
        End With
    End Function
    Thanks

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Distribuation Problems With DataEnvironment

    Quote Originally Posted by cgraham
    Hi tg,
    basically it is not connecting to the MDB at all. err.description is "Application-defined or object defined-error"
    What line of code generates this error?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    26

    Re: Distribuation Problems With DataEnvironment

    Quote Originally Posted by Hack
    What line of code generates this error?
    Hi Hack,
    its leaving the Empty_ValuesTable sub at the with dataenvironment1 line, then calling the error handler in the form_load.

    Thanks for your help so far guys. Really appreciate it. The user is dying to test this before I leave

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Distribuation Problems With DataEnvironment

    Is this function in a module, or on the form with the DataEnvironment control?

  7. #7
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Distribuation Problems With DataEnvironment

    Is the database located in the same drive and folder on the other machine (c:\mydata\yourdb.mdb). If not then you can set your connectionstring at runtime.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    26

    Re: Distribuation Problems With DataEnvironment

    Hi Wes,
    the paths are the same. This is essentially an appliaction extension, so we picked a folder in the host app's structure that has to be present for it to open. "C:\ArcGIS\arcexe9x\bin"

    Hack,
    the Empty_ValuesTable sub is on a module. The rest is on a form. This is an Active X DLL by the way... not sure if that changes something that your thinking might be the problem.

    Cheers all.

  9. #9
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Distribuation Problems With DataEnvironment

    Well, there's the problem there.... the DE is on a form (or user control).... so the sub doesn't know that.... so as soon as it hits DataEnvironment1, it's going "what the heck? Where's that at?" .....

    I'm guessing that you don't have Option Explicit turned on do you?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  10. #10

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    26

    Re: Distribuation Problems With DataEnvironment

    Hi tg,
    I'll give it try on the form, but why would this not cause any trouble on my machine? The whole tool runs fine on machines that have Visual Studio on them.

    Option explicit was on and everything but the module that the Empty_ValuesTable sub is on. I put explicit on that as well, and it still compiles. I'll push it out to the client to see if it makes a difference.

    Thanks guys
    Craig

  11. #11
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Distribuation Problems With DataEnvironment

    Access database, right? Has the user's machine had MDAC installed on it? If not, download MDAC (I recommend 2.6 or 2.7) and install that on the user's machine as well.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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