Modified Database release script gives database readonly err

Modified Database release script gives database readonly err

Postby Swapna » Sun Jan 13, 2013 11:04 am

Hi All,

I have a modified database release script which was working fine on Kofax capture 8. Now we have upgraded the system to kofax 10 and old databse release script is not working with it. We have compiled the old source code which is in VB with help of Kofax suport and installed it on Kofax 10. Now this database release is keeping on giving database reladonly error.

Following is the exact message in err log
2013-01-13 09:12:13, 0x00000018, 0, 0x00000BD3, 0x00000000, 0x00000000, C:\Program Files (x86)\Kofax\Capture\Bin, Kofax Capture Export, USERPC:Sess 1, 10.00.4554, DatabasePlus Release Script:Database Class.ReleaseIndexes:Database Class.ReleaseDocTable:DAO.Recordset, 1110, Document Table (dbo.DocTab: 2: Sales: : user: ): Cannot update. Database or object is read-only. Probably lacking unique index., ,

This error is happening while adding a new recordset. The datatable and index table are empty now. ie, there is no unique id conflict.

Thanks for any help.

Thanks,
Swapna.
Swapna
Participant
 
Posts: 17
Joined: Wed Sep 03, 2008 2:45 am
Location: UAE

Re: Modified Database release script gives database readonly err

Postby russell@centuryc.com » Sun Jan 13, 2013 10:42 pm

Can't say as I've seen the "read only", but it can happen if someone has the database open in the mode where they can modify the structure.

As for the unique index, that may be a structural issue - either the key isn't assigned or the data type for that key is wrong from what the release script is expecting.

Bottom line, I think the fact you've moved to KC10 is a red herring. I think your problem is with the database itself.
Russell
russell@centuryc.com
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Modified Database release script gives database readonly err

Postby Swapna » Mon Jan 14, 2013 12:53 am

Hi Russel,

Thanks for the reply.

The default database release from kofax is working fine on the same table structure.

The problem happens with the old modified release script.

In Defaulf Kofax release script is .net based while the release script which I am working on is VB code base and database elements are accessed by DAO.

I could see the this error pops up when a AddNew is called for a recordset.

The code sample where the problem pops up is at line No:1234 below.

'*************************************************
' ReleaseDocumentTable
'-------------------------------------------------
' Purpose: This routine releases the DocID and
' DocPath to the documents table.
' Inputs: TheData ReleaseData object
' PathName optional release path
' Outputs: None
' Returns: None
' Notes: None
'*************************************************
Sub ReleaseDocTable(TheData As ReleaseData, ByVal PathName As String)
Dim sPathName As String
Dim sErrMsg As String
Dim nWriteAttempts As Integer
Dim ErrPlace As String

On Error GoTo RDT_LogAndPropError

' If we are given the optional PathName use it.
If (IsMissing(PathName)) Then
sPathName = ""
ElseIf (Len(PathName) <> 0) Then
sPathName = PathName
End If

' Add new record to the documents table for this document.
' The table may be locked so retry if necessary.
On Error GoTo RDT_TableError
nWriteAttempts = 2
ErrPlace = "AddNew"
1234 grsDocTable.AddNew

...................
..............
End Sub

Any idea?

Thanks in advance,
Swapna.
Swapna
Participant
 
Posts: 17
Joined: Wed Sep 03, 2008 2:45 am
Location: UAE

Re: Modified Database release script gives database readonly err

Postby Swapna » Mon Jan 14, 2013 8:10 am

Hi,

I could extract the code resulting in error from the code base in a VB form as follows.
-------------------------------------------------------------------------------------------------------------
Option Explicit
Dim grsIndexTable As Recordset
Dim grsDocTable As Recordset
Public DBConnection As Database
Public oWorkSpace As Workspace
Public oDbEngine As New PrivDBEngine
Public ErrorLineNum As Integer


Private Sub Form_Load()
On Error GoTo Error_Handler
530 Set oWorkSpace = oDbEngine.CreateWorkspace("Test", "Admin", "")
540 Set DBConnection = oWorkSpace.OpenDatabase("", False, False, "ODBC;DSN=Sales;UID=user;PWD=")
1020 Set grsDocTable = DBConnection.OpenRecordset("DocTab1")
1234 grsDocTable.AddNew
1120 grsDocTable.Fields("DocID") = 3
1130 grsDocTable.Fields("Path") = "My Path"
1140 grsDocTable.Update
Exit Sub
'---------------
' Error Handler
'---------------
Error_Handler:
If (ErrorLineNum = 0) Then
ErrorLineNum = Erl
End If

MsgBox (ErrorLineNum & Err.Description)
End Sub
--------------------------------------------------------------------------------------------------------------
This piece of code is exactly showing the error I encounter in database release. Could any one provide a light on this?

Thanks,
Swapna.
Swapna
Participant
 
Posts: 17
Joined: Wed Sep 03, 2008 2:45 am
Location: UAE

Re: Modified Database release script gives database readonly err

Postby russell@centuryc.com » Mon Jan 14, 2013 11:31 am

I know there's a series of DLLs that have to be copied over to make old VB scripts work. I wonder if you're missing one.

My list includes KfxVar.dll, mscomct2.ocx, MSCOMCTL.OCX, and TABCTL32.OCX.
Russell
russell@centuryc.com
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Modified Database release script gives database readonly err

Postby Swapna » Mon Jan 14, 2013 8:37 pm

Hi Russel,
Thanks for the reply. I dont find these files being referenced in the code base. How can I get these files?

I couldnt find these files from my current kofax10 bin folder. Can I need to get from a Kofax 8 installation bin folder? If I get it is it ok to put in the my Kofax 10 bin folder and reference it?

Thanks,
Swapna.
Swapna
Participant
 
Posts: 17
Joined: Wed Sep 03, 2008 2:45 am
Location: UAE

Re: Modified Database release script gives database readonly err

Postby Swapna » Mon Jan 14, 2013 8:41 pm

Hi Russel,

I got another info regarding my database being readonly from net by following link.

http://msdn.microsoft.com/en-us/library ... =office.12).aspx

Which is exactly the error I am receiving now. But I dont know how old release scripts were working fine in Kofax 8.

Thanks,
Swapna.
Swapna
Participant
 
Posts: 17
Joined: Wed Sep 03, 2008 2:45 am
Location: UAE

Re: Modified Database release script gives database readonly err

Postby russell@centuryc.com » Tue Jan 15, 2013 5:58 pm

Swapna wrote:I got another info regarding my database being readonly from net by following link.

http://msdn.microsoft.com/en-us/library ... =office.12).aspx


I got "How to: Modify an Existing Record in a DAO Recordset". I didn't see any connection to the problem.
Russell
russell@centuryc.com
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Modified Database release script gives database readonly err

Postby Swapna » Tue Jan 15, 2013 9:22 pm

Hi Russel,

The piece of code I had put is using DAO.

I almost fixed this issue by changing the DAO programming by ADO programming.

Thanks for the help,
Swapna.
Swapna
Participant
 
Posts: 17
Joined: Wed Sep 03, 2008 2:45 am
Location: UAE

Re: Modified Database release script gives database readonly err

Postby russell@centuryc.com » Wed Jan 16, 2013 12:29 pm

Starting to sound like a timing issue - the next document is trying to release before the first one is fully wrapped up.
Russell
russell@centuryc.com
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Modified Database release script gives database readonly err

Postby Swapna » Wed Jan 23, 2013 12:12 am

Hi Russel,

I started to find a problem with this code base when I moved it to client's machine.

The DBRel.dll was working fine on the server machine which was windows server 2008.

The same DBRel.dll when i tried to register on client machine it worked fine. But the export connection setup was not coming up. The error log first gave following error.
Component 'TABCTL32.OCX' or one of its dependencies not correctly registered: a file is missing or invalid

I copied this OCX from Server machine and registered the same in the client message. Then I got following error.

Component 'MSCOMCT2.OCX' or one of its dependencies not correctly registered: a file is missing or invalid, ,

Again I copied the this OCX from Server machine and registered the same in the client machine. Then when I opened the export connection setup it is about to open but later closed by windows saying error.

I have copied 'MSCOMCTL.OCX' from Server machine and registered the same in the client machine. Still I face the same bahaviour. Export connector setup is being closed by Windows. No message is available in Kofax logs also.

Is there a way out?

Thanks,
Swapna.
Swapna
Participant
 
Posts: 17
Joined: Wed Sep 03, 2008 2:45 am
Location: UAE

Re: Modified Database release script gives database readonly err

Postby russell@centuryc.com » Wed Jan 23, 2013 11:29 am

russell@centuryc.com wrote:I know there's a series of DLLs that have to be copied over to make old VB scripts work. I wonder if you're missing one.

My list includes KfxVar.dll, mscomct2.ocx, MSCOMCTL.OCX, and TABCTL32.OCX.


Look for a "Export Connectors\VB6 Components" folder on the DVD. That should get you the OCX files. The DLL will have to come from a KC8 system.

Just drop them in the BIN folder for capture on each machine. That should be all you need.
Russell
russell@centuryc.com
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA


Return to Release Scripts General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron