cancel
Showing results for 
Search instead for 
Did you mean: 

VB Script To Create External Keyword DataSet

Aymard_Moyo
Champ on-the-rise
Champ on-the-rise

Hi, I want to create an external keyword DataSet, with data retrieved from an external database.
I use a database created in SQL Server. To connect to this database I have configured an ODBC data source (32 bits).

My VBScript code is described below.

However, when I try to test my External DataSet I can't get any results. I think is the connection with the database.

I also try with SQL Select String, but i got empty result. 

Can someone helps me ? 

Configuration : 

  • SGBD : My SQL Server 
  • Odbc Data Source : DNS 32 bit
  • OnBase Version : 16
  • OS: Windows Server 2016

da874cc155124345ab467865bcfbd4ab1ce9fe4d3d8e485b8d775a827f11d520

 

Sub GetKeywordDataSetRecords(filterValue, context, results)	Const DB_DSN = "DSN=Dematerialisation_DEV;UID=hsi;PWD=******;"	Dim oConn	Dim sSQL	Dim oRecordSet	Set oConn = CreateObject("ADODB.Connection")	oConn.Open DB_DSN		sSQL = "select username FROM useraccount WHERE username LIKE '" & filterValue & "%'"		Set oRecordSet = CreateObject("ADODB.Recordset")	oRecordSet.Open sSQL, oConn, adOpenKeyset				While Not oRecordSet.EOF ' Loop until endd fo file is reached 		CALL results.BeginRow()		CALL results.AddData("keyvaluechar",oRecordSet(0))		CALL results.EndRow()		oRecordSet.MoveNext 'Moves the RecordSet pointer to the next position             	Wend		oRecordSet.Close	oConn.Close		Set oRecordSet = Nothing	Set oConn = Nothing	End Sub
1 ACCEPTED ANSWER

Eric_Beavers
Employee
Employee

I think your query needs the schema

SELECT username FROM hsi.useraccount

View answer in original post

1 REPLY 1

Eric_Beavers
Employee
Employee

I think your query needs the schema

SELECT username FROM hsi.useraccount