List of Validation Scripts supported by Kofax Ascent Capture

List of Validation Scripts supported by Kofax Ascent Capture

Postby vedavyasavadhani » Wed Aug 01, 2007 9:01 pm

Hello,

I am fresh member to this forum. Also I am new to the Kofax Ascnet Capture. I have some queries listed below. Could anyone please answer these queries ?

- I want to know list of Validation Scripts supported by Kofax (Like SBL)-

- Is it possible to call a stored procedure from SBL script ?

- If VB is supported , then Is it possible to call a stored procedure from VB script ?

- Can we get a multiple values from databse in SBL ?

Eagerly awaiting for the answer..
vedavyasavadhani
Participant
 
Posts: 132
Joined: Wed Aug 01, 2007 8:50 pm

Re: List of Validation Scripts supported by Kofax Ascent Capture

Postby russell@centuryc.com » Wed Aug 01, 2007 9:54 pm

Answers inline:

I want to know list of Validation Scripts supported by Kofax (Like SBL)-

Just SBL, but you can create an OCX panel

Is it possible to call a stored procedure from SBL script ?

A SQL procedure? I think so.

Can we get a multiple values from databse in SBL ?

Yes, but displaying them to an operator to select the desired one isn't easy.
russell@centuryc.com
Participant
 
Posts: 3235
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Postby vedavyasavadhani » Thu Aug 02, 2007 12:38 am

I heard that we can write Validation Script in VB via COM Interface. But I too not sure on this.
vedavyasavadhani
Participant
 
Posts: 132
Joined: Wed Aug 01, 2007 8:50 pm

Postby russell@centuryc.com » Thu Aug 02, 2007 1:07 pm

Maybe. I know you can get SBL to call VB stuff, but unfortunately I know zilch about VB. :oops:

I've been told that SBL is old version of VB without the visual interface.
russell@centuryc.com
Participant
 
Posts: 3235
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Postby cgodby » Fri Aug 03, 2007 1:26 am

Writing stuff in VB6 or .Net and accessing them via COM is fine and you'll have no problem in calling them from your validation script - it's a technique I use a lot, especially when using web services and the like.
cgodby
Participant
 
Posts: 166
Joined: Tue Dec 20, 2005 2:49 am
Location: England

Postby vedavyasavadhani » Sun Aug 05, 2007 8:11 pm

Can anyone provide me some sample code that includes making connection to the MS SQL Server...? I am new to this database connectivity and Lookups. topics..
vedavyasavadhani
Participant
 
Posts: 132
Joined: Wed Aug 01, 2007 8:50 pm

Postby David » Sun Aug 05, 2007 11:48 pm

vedavyasavadhani wrote:Can anyone provide me some sample code that includes making connection to the MS SQL Server...? I am new to this database connectivity and Lookups. topics..

Can anyone provide me some sample code that includes making connection to the MS SQL Server. please?

There are several samples/discussions in this forum on DB connectivity from within SBL. You could try to search on 'sbl sql ado odbc' or such terms. There is several code samples posted and discussed in more or less detail. Perhaps they can give you a boost in the right direction. It all depends very much on your own background and current situation of course.

If you search the public Kofax kb on, for example 'sbl sql' you will quiclky find topics such as 'How can I access an ODBC Data Source from within a Validation Script?' Just a brief article but still something to start with.

Otherwise there should be plenty on the net or in a good book store with computer literature.
If you make it idiot-proof, someone will make a better idiot.
User avatar
David
Participant
 
Posts: 1501
Joined: Wed Dec 07, 2005 4:08 am

Postby RobertMinneman » Mon Aug 06, 2007 10:16 am

I approached this as simply as I could.

Assumption #1:
There is an ODBC DSN already configured the desired database and it has been configured for Windows NT authentication.

Assumption #2:
All users have SELECT access to the validation database based off their NT ID.

If either assumptions are wrong, this process fails.

Here's the full function:

Function funcDBVAlidate () As Integer
On Error GoTo Failure

'List of fields to be validated:
'KfxCCAN_CIB_Number
'KfxContract_Number
'KfxLegacy_Number
'KfxDocument_Type
'KfxCustomer_Name
'KfxScan_Date
'KfxDivision_Portfolio
'KfxDocument_Number

Dim strQuery as string
Dim strOutput as string
Dim lngConnection as long
Dim intReturn as integer
Dim intGoodQuery as integer
Dim aryDocumentResultSet(6,1) as Variant
' aryDocumentResultSet(1,x) = object_number, or KfxDocument_Number
' aryDocumentResultSet(2,x) = user_object_number_2, or KfxContract_Number
' aryDocumentResultSet(3,x) = department_client, or KfxDivision_Portfolio (phase 1)
' aryDocumentResultSet(4,x) = object_description, or KfxCustomer_Name (phase 1)
' aryDocumentResultSet(5,x) = generic_1, or KfxLegacy_Number
' aryDocumentResultSet(6,x) = generic_2, or KfxCCAN_CIB_Number

Dim aryDivCodeResultSet(1,1) as Variant
' aryDivCodeResultSet(1,1) = contact1_mail_stop, or KfxDivision_Portfolio (phase 2)

strQuery = "select object_number, user_object_number_2, department_client, object_description, generic_1, generic_2 from document where user_object_number_2 like '" & KfxContract_Number & "%'"

intReturn = SQLRequest("DSN=SELD32;UID=;PWD=",strQuery,strOutput,4,0,aryDocumentResultSet())
if gintVerboseMode = 1 then ' RJM - 2007-04-12
MsgBox "Return Count: " & intReturn & chr$(10) & _
"Query: " & strQuery & chr$(10) & _
"Output: " & strOutput & chr$(10) & _
"Document Number: " & aryDocumentResultSet(1,1) & chr$(10) & _
"Contract Number: " & aryDocumentResultSet(2,1) & chr$(10) & _
"CCIB_Division: " & aryDocumentResultSet(3,1) & chr$(10) & _
"Customer Name: " & aryDocumentResultSet(4,1) & chr$(10) & _
"Legacy Number: " & aryDocumentResultSet(5,1) & chr$(10) & _
"CCIB Number: " & aryDocumentResultSet(6,1),0,"funcDBVAlidate - SQLRetrieve1" ' RJM - 2007-04-12
end if ' RJM - 2007-04-12

if intReturn > 0 then
KfxDocument_Number = "D" & aryDocumentResultSet(1,1)
KfxContract_Number = aryDocumentResultSet(2,1) ' RJM - 2007-04-12
KfxCustomer_Name = mid(aryDocumentResultSet(4,1),16, instr(17,aryDocumentResultSet(4,1),"DBA:")-18) ' RJM - 2007-03-28
KfxLegacy_Number = aryDocumentResultSet(5,1) ' RJM - 2007-04-12
KfxCCAN_CIB_Number = aryDocumentResultSet(6,1) ' RJM - 2007-04-12
gintPreValidated = 1
intGoodQuery = 1
else
gintPreValidated = 0
end if

strQuery = "select contact1_mail_stop from departments_clients where department_client_code= '"& aryDocumentResultSet(3,1) & "'" ' RJM - 2007-04-12
intReturn = SQLRequest("DSN=SELD32;UID=;PWD=",strQuery,strOutput,4,0,aryDivCodeResultSet())
if gintVerboseMode = 1 then ' RJM - 2007-04-12
MsgBox "Return Count: " & intReturn & chr$(10) & _
"Query: " & strQuery & chr$(10) & _
"Output: " & strOutput & chr$(10) & _
"CCIB_Division: " & aryDivCodeResultSet(1,1),0,"funcDBVAlidate - SQLRetrieve2" ' RJM - 2007-04-12
end if ' RJM - 2007-04-12

if len(trim(aryDivCodeResultSet(1,1))) > 0 then
KfxDivision_Portfolio = aryDivCodeResultSet(1,1) ' RJM - 2007-04-12
intGoodQuery = 1 ' RJM - 2007-04-12
end if

If trim(KfxDivision_Portfolio) = "" then ' RJM - 2007-04-12
KfxDivision_Portfolio = "-" ' RJM - 2007-04-12
end if ' RJM - 2007-04-12
If trim(KfxLegacy_Number) = "" then ' RJM - 2007-04-12
KfxLegacy_Number = "-" ' RJM - 2007-04-12
end if ' RJM - 2007-04-12
If trim(KfxCCAN_CIB_Number) = "" then ' RJM - 2007-04-12
KfxCCAN_CIB_Number = "-" ' RJM - 2007-04-12
end if ' RJM - 2007-04-12
If trim(KfxContract_Number) = "" then ' RJM - 2007-04-12
KfxContract_Number = "-" ' RJM - 2007-04-12
end if ' RJM - 2007-04-12

if intGoodQuery > 0 then ' RJM - 2007-04-12
funcDBValidate = 1 ' RJM - 2007-04-12
else ' RJM - 2007-04-12
funcDBValidate = 0 ' RJM - 2007-04-12
end if ' RJM - 2007-04-12

Exit Function

Failure:
MsgBox "There's been a failure." & chr$(10) & _
"Error Number: " & Err,0,"funcDBVAlidate - Failure"

funcDBValidate = 0
Exit Function
End Function
RobertMinneman
Participant
 
Posts: 86
Joined: Wed Nov 01, 2006 2:17 pm

Postby vedavyasavadhani » Mon Aug 06, 2007 8:57 pm

Thank you for the support. I got 2 sample code by which I can do connection to the DataBase from SBL :

1) Global rs as Object
Global db as Object

'initialise the adodb variables and connect to database
Set rs = createobject("ADODB.Recordset")
Set db = createobject("ADODB.Connection")
db.Open "DSN=Kofax;UID=;PWD="

2) Dim connection As Long
Dim destination(1 To 50, 1 To 125) As Variant
Dim retcode As long
' open the connection
connection = SQLOpen("DSN=....; UID=....; PWD=.....")

So which one do you people think is the best way to do. I also would like to know the purpose of "Dim destination(1 To 50, 1 To 125) As Variant ".

PS: For me 1st one looks good :D
vedavyasavadhani
Participant
 
Posts: 132
Joined: Wed Aug 01, 2007 8:50 pm

Postby preisinger » Tue Sep 11, 2007 7:19 am

you can also create an ADODB.Command object
and use it along with the Connection
to call the Stored Procedure using parameters.
Here is an example I use connecting to the AS400 and
calling the SP "setDIInvoiceStat".

set AS400DBConnection = CreateObject("ADODB.Connection")
set AS400DBCommand= CreateObject("ADODB.Command")
set AS400ADORecordset = CreateObject("ADODB.Recordset")

AS400DBConnection.ConnectionString = "DSN=####;User Id=yyyy;Password=zzzz;"
AS400DBConnection.Open
set AS400DBCommand.ActiveConnection = AS400DBConnection
callText="call setDIInvoiceStat ('2','" + inVendorNum +"','" + inInvNum + "','D',?,?,?)"
AS400DBConnection.CommandText=CallText

Set param1 = CreateObject("ADODB.Parameter")
Set param2 = CreateObject("ADODB.Parameter")
Set param3 = CreateObject("ADODB.Parameter")
set param1 = AS400DBConnection.CreateParameter("ORTNCODE", 129, 2,1)
set param2 = AS400DBConnection.CreateParameter("OMSGCODE", 129, 2,6)
set param3 = AS400DBConnection.CreateParameter("OERRORMSG", 129, 2,250)
AS400DBConnection.Parameters.Append param1
AS400DBConnection.Parameters.Append param2
AS400DBConnection.Parameters.Append param3
AS400DBConnection.Execute
preisinger
Participant
 
Posts: 63
Joined: Mon Nov 06, 2006 1:17 pm


Return to Kofax Capture General Discussion

Who is online

Users browsing this forum: No registered users and 11 guests