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
Re: Distribuation Problems With DataEnvironment
What's the error? It could be a number of things....
-tg
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
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?
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 :)
Re: Distribuation Problems With DataEnvironment
Is this function in a module, or on the form with the DataEnvironment control?
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.
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.
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
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
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