Book a Demo

Author Topic: Element Update (Insert) on POSTGRES?  (Read 3016 times)

m2i7c9k

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Element Update (Insert) on POSTGRES?
« on: July 10, 2019, 06:52:01 pm »
Hi Guys,

I'm here again with the 2nd step of my code. The code below works on MSSQL, JET but PROGRES NO :/
Is there some special workaround for update/insert for PROGRES repository.

On PROGRES repository I've got the error: Object variable or With block variable not set.

Thanks


Public Sub UpdateEAObject(objName As String, objNote As String, objGUID As String, objType As EAObjectType)
        'Saving EA element by element type.
        'The eaObject could be a Package, a Diagram, and an Element.
       
        Dim eaObject As Object = Nothing

        If objType = 0 Then
            eaObject = EARep.GetPackageByGuid(objGUID)
        ElseIf objType = 1 Then
            eaObject = EARep.GetDiagramByGuid(objGUID)
        ElseIf objType = 2 Then
            eaObject = EARep.GetElementByGuid(objGUID)
        End If

        With eaObject
            .Name = objName
            .Notes = objNote
            .Update()
        End With

        EARep.RefreshOpenDiagrams(True)
    End Sub

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Element Update (Insert) on POSTGRES?
« Reply #1 on: July 10, 2019, 08:04:58 pm »
This has nothing to do with the used DB. It's (as it seems) that you don't get an object return. Maybe (!) it's case sensitivity that plays a role here. Check if the guid you search matches exactly that inside the database.

q.

m2i7c9k

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Re: Element Update (Insert) on POSTGRES?
« Reply #2 on: July 10, 2019, 10:56:17 pm »
Yes, it was a case-sensitivity "problem."
Thanks for a tip where to look.
Finally, it's working well.