You are viewing limited content. For full access, please sign in.

Question

Question

Using MS Access to update template fields

asked on February 14, 2019 Show version history

I am looking for a way to update a template in LF from MS Access.  Currently we scan in a document, then manually enter all the field data on the template, then open MS Access and update the database with the same field data and also record the entry ID.  The MS Access database has a script written in to create a hyperlink to the document in webaccess.

 

We have LF RIO 10.2., workflow and import agent.  

 

Thanks in advance!

0 0

Replies

replied on February 15, 2019

If you want the update to flow from LF to Access DB, you can potentially use workflow to push the data.

If you need to update LF from Access, you would either need to use the SDK and VBA or if you do not need it to be immediate, you can potentially a scheduled workflow to query the Access DB and then update corresponding entries in the repository.

One thing of note is that SQL is much better suited for this type of a job.  I would think that using a SQL DB and then linking your Access to it would be a more reliable route.

2 0
replied on February 15, 2019

Workflow can also generate a Web Access link. It's better to generate links that way, because then you know that they'll always be correct. The format is simple, and hasn't changed in a while, but by allowing Workflow to do it you know you'll always have the correct format for the current version.

1 0
replied on February 15, 2019

Thanks, I was thinking I would need to use the SDK and VBA.  I need Access to update the template. Just not sure how to get it going.   

0 0
replied on February 16, 2019 Show version history

The VBA compiler/engine is basically VB6 so you will need to use the LFSO COM DLL instead of the RA .Net DLL.

Here are LogIn and LogOut methods for VBA

Private Sub LogIn(ByRef LFDB As LFSO103Lib.LFDatabase, ByVal LFServerName As String, ByVal LFRepositoryName As String, ByVal LFUserName As String, ByVal LFPassword As String)
  Dim app As LFSO103Lib.LFApplication
  Dim serv As LFSO103Lib.LFServer
  Dim conn As LFSO103Lib.LFConnection
  If LFDB Is Nothing Then
    On Error GoTo ErrHandler:
    ' Creates a new application object.
    Set app = New LFSO103Lib.LFApplication
    ' Finds the appropriate server.
    Set serv = app.GetServerByName(LFServerName)
    ' Gets the repository from the server.
    Set LFDB = serv.GetDatabaseByName(LFRepositoryName)
    ' Creates a new LFConnection object.
    Set conn = New LFSO103Lib.LFConnection
    ' Sets the user name and password.
    conn.UserName = sLFUserName
    conn.Password = sLFPassword
    ' Connects to repository.
    conn.Create LFDB
  End If
  Exit Sub
ErrHandler:
  MsgBox Err.Number & vbCrLf & "Failed to Log in", vbCritical + vbOKOnly, "Error"
  Set LFDB = Nothing
End Sub

Private Sub LogOut(ByRef LFDB As LFSO103Lib.LFDatabase)
  Dim conn As LFSO103Lib.LFConnection
  If Not LFDB Is Nothing Then
    On Error GoTo ErrHandler:
    ' Get LF Connection object
    Set conn = LFDB.CurrentConnection
    ' Log Out / Close connection
    conn.Terminate
    Set conn = Nothing
  End If
ErrHandler:
  Set LFDB = Nothing
End Sub

Then to Log in, you would do:

Private Sub btnProcess_Click()
  Dim sLFServerName As String
  Dim sLFRepositoryName As String
  Dim sLFUserName As String
  Dim sLFPassword As String
  Dim db As LFSO103Lib.LFDatabase
  ' To use Windows Authentication
  ' Make the sLFUserName and sLFPassword = ""
  ' Edit the next 4 lines to set up login info
  sLFServerName = "YourLFServerName"
  sLFRepositoryName = "YourRepositoryName"
  sLFUserName = "YourUserName" ' For Windows Authentication = ""
  sLFPassword = "YourPassword" ' For Windows Authentication = ""
  ' Start the LF Update
  Set db = Nothing
  ' Log into the repository
  LogIn db, sLFServerName, sLFRepositoryName, sLFUserName, sLFPassword
  ' Only process if the Login was successfull
  If Not db Is Nothing Then
    On Error GoTo ErrHandler:
    'Do your work here

    'Done with work
lblReturn:
    ' Log Out of Repository
    LogOut db
  End If
  Exit Sub
ErrHandler:
  ' Inform user of error
  MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly, "Error"
  ' Return to log out of repository
  GoTo lblReturn:
End Sub

 

 

 

1 0
replied on February 22, 2019

Thanks!  That'll save me some time working on this!

 

 

0 0
replied on February 27, 2019

Taking a different approach.  Will be exporting the records from Access to an XML file, import agent and workflow will process the xml and update the template.   

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.