BOSS 7 |1'0' ?' '%( (('(?(g'(J*(  ?(\(#( ( 42((N , 1(v n)#) ,<) -< 3n)") ) j2)  Q) )    )/ (*,>*_3**y% *F ++z++`4 +: 7+!"}, /+ ;1 +' I.+o +6 c=+ $+-0 } + < 4+ J$d3 + $+~ * *+ >+%9 9+? X!+Y/++5+s&> + r0+4,+h +1+"N; + ?+)(+C77<Joops.OfficeTalk.ScriptExportCore.Array@replaceOptionobjects  Joops.Scripting.ScriptpersistentObjectdirtynamemethods"&*.2Joops.Scripting.ScriptNameparentglobalCategoryglobalNamecategoryname>BFJN:R6bDBVZ^Core.OrderedCollectionfirstIndexlastIndexjnf @rwithAll:Joops.Scripting.ScriptMethodSourcesourcestartMethodarguments"&*~Joops.Scripting.ScriptMethodName>BFJNUpdateCore.GapStringstringgapStartgapSize^Update ( SQLClause As Joops.Scripting.SQLString, Columns As Array, Data As Array ) 'Created: 1.2.2008 - JOOPS Informationstechnik GmbH, Josef Springer ' 'Writes a new record in a database. 'SQLClause contains the complete Select-clause (WHERE is required !) and is declared as SQLString for dynamicly 'substitution of variables.on of variablesfor the database with DB.Connectand is declared as 'Joops.Scripting.SQLString for dynamicly'substitution of variables e.g. SELECT * FROM schema.table WHERE name = "Springer" 'Get the connection string for the database with DB.ConnectString ' '13.8.2007 JOOPS Informationstechnik GmbH, Josef Springer 'Recordset must be initiated with 'cursorType( Enum( SmallCOM.ADODB.CursorTypeEnum, adOpenKeyset ) ) 'cursorLocation( Enum( SmallCOM.ADODB.CursorLocationEnum, adUseClient ) ) 'to perform writing of new records ' 'Arguments: SQLClause The SELECT-clause for the query (including WHERE) ' Columns The column names ' Data The values of the Columns ' 'Returns: Boolean Done (True) or failure (False) Library "..\Library\Microsoft ADODB.pcl" Dim recordset As SmallCOM.ADODB.Recordset Dim flds As SmallCOM.ADODB.Fields Dim field As SmallCOM.ADODB.Field Dim i As Integer i = 0 Try recordset = New SmallCOM.ADODB.Recordset recordset.cursorLocation( Enum( SmallCOM.ADODB.CursorLocationEnum, adUseClient ) ) recordset.lockType( Enum( SmallCOM.ADODB.LockTypeEnum, adLockBatchOptimistic ) ) recordset.open( SQLClause, activeConnection: Call DB.ConnectString ) recordset.editMode flds = recordset.fields Do Until i = UBound( Columns ) field = flds.item( Columns( i ) ) field.value( Data( i ) ) i = i + 1 Loop recordset.updateBatch recordset.close Return True End Try Catch MsgBox( Error.description ) Return False End CatchCJoops.Scripting.SQLStringArrayArrayvzDB2ConnectString5DB2ConnectString 'Get the standard connection string for a DB2 database 'The connection is used at host JosMobil, database OFFICETA, with login OfficeTalk/OfficeTalk ' 'Return: String Return "Provider=IBMDADB2;HOSTNAME=JosMobil;Database=OFFICETA;PROTOCOL=TCPIP;PORT=50000;uid=OfficeTalk;pwd=OfficeTalk;"vz ConnectStringrConnectString 'Get the standard connection string for the database. 'The connection string for a PostgreSQL database is answered by default. 'For a Microsoft SQL-Server use: DB.MSSQLConnectString: 'For an Access database use: DB.AccessConnectString 'For a DB2 database use: DB.DB2ConnectString ' 'Return: String Return Call DB.PostgreSQLConnectStringvzAccessConnectStringAccessConnectString 'Get the standard connection string for a Access database 'The connection is used for the database C:\Projekte.mdb ' 'Return: String Return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Projekte.mdb;"vz*.2MSSQLConnectString"&&MSSQLConnectString 'Get the standard connection string for a Microsoft SQL-Database 'The connection is used at host joops1, database OfficeTalk, with login OfficeTalk/OfficeTalk ' 'Return: String Return "Driver={SQL Server};Server=joops1;Uid=OfficeTalk;Pwd=OfficeTalk;Database=OfficeTalk"vz>FJBearbeiter6:Bearbeiter 'Get all rows from the table bearbeiter in the database. 'Get with DB.MSSQLConnectionString the connection values for the database. '(This example uses a real table from OfficeTalk environment) ' 'Returns: Array The rows or Null on failure Library "..\Library\microsoft adodb.pcl" Dim recordset As SmallCOM.ADODB.Recordset Dim Ergebnis As Array Dim Spalten As SmallCOM.ADODB.Fields recordset = New SmallCOM.ADODB.Recordset Try cordset.cursorType( Enum( SmallCOM.ADODB.CursorTypeEnum, adOpenKeyset ) ) recordset.cursorLocation( Enum( SmallCOM.ADODB.CursorLocationEnum, adUseClient ) ) recordset.lockType( Enum( SmallCOM.ADODB.LockType = New SmallCOM.ADODB.Recordset Try recordset.cursorType( Enum( SmallCOM.ADODB.CursorTypeEnum, adOpenKeyset ) ) recordset.cursorLocation( Enum( SmallCOM.ADODB.CursorLocationEnum, adUseClient ) ) recordset.lockType( Enum( SmallCOM.ADODB.LockTypeEnum, adLockBatchOptimistic ) ) recordset.open( "SELECT * from bearbeiter", activeConnection: Call DB.MSSQLConnectString ) End Try Catch Return Null End Catch While recordset.eof = False Spalten = recordset.fields Ergebnis( Ergebnis.size ) = Array( Spalten.item( "shortcut" ).value, Spalten.item( "password" ).value) recordset.moveNext Wend recordset.close Return ErgebnisBvzVZ^BearbeiterInOracleNRBearbeiterInOracle 'Get all rows from the table bearbeiter in the database. 'Notify with MsgBox the id and shortcut of all bearbeiter 'This example uses a real table from OfficeTalk environment assuming: 'Databaseservice: OFFICETA 'Login: OfficeTalk/OfficeTalk ' 'Returns: Library "..\Library\OracleForOfficeTalk.pcl" Dim session As SmallCOM.OracleForOfficeTalk.OfficeTalkSession session = New SmallCOM.OracleForOfficeTalk.OfficeTalkSession Try session.openDatabase( "OFFICETA", connect: "OfficeTalk/OfficeTalk", connectType: 0 ) End Try Catch MsgBox( "Connecterror: " & session.lastServerErrText, , vbCritical ) Return Null End Catch Try session.createDynaset( "SELECT id, shortcut FROM bearbeiter", queryOption: 0 ) While session.eof = False MsgBox( Array( "ID: ", session.item( "id" ), " Shortcut: ", session.item( "shortcut" ) ), , vbInformation ) session.moveNext Wend End Try Catch MsgBox( "Selecterror: " & session.lastServerErrText, , vbExclamation ) End CatchvzjnrPostgreSQLConnectStringbf PostgreSQLConnectString 'Get the standard connection string for a PostgreSQL database 'The connection is used at the local host with login OfficeTalk/OfficeTalk ' 'Return: String Return "Driver={PostgreSQL Unicode};Server=localhost;Uid=OfficeTalk;Pwd=OfficeTalk;Database=OfficeTalk"vz~NewvzNew ( SQLClause As Joops.Scripting.SQLString, Columns As Array, Data As Array ) 'Created: 1.2.2008 - JOOPS Informationstechnik GmbH, Josef Springer ' 'Writes a new record into the database. 'SQLClause contains the Select-clause defining the table for the new record and is declared as SQLString for dynamicly 'substitution of variables. .SQLString for dynamicly'substitution of variable. 'e.g. SELECT * FROM schema.table 'Get the connection string for the database with DB.ConnectString ' '13.8.2007 JOOPS Informationstechnik GmbH, Josef Springer 'Recordset must be initiated with 'cursorType( Enum( SmallCOM.ADODB.CursorTypeEnum, adOpenKeyset ) ) 'cursorLocation( Enum( SmallCOM.ADODB.CursorLocationEnum, adUseClient ) ) 'to perform writing of new records ' 'Arguments: SQLClause The SELECT-clause for the query ' Columns The column names ' Data The values of the Columns ' 'Returns: Boolean Done (True) or failure (False) Library "..\Library\Microsoft ADODB.pcl" Dim recordset As SmallCOM.ADODB.Recordset Dim flds As SmallCOM.ADODB.Fields Dim field As SmallCOM.ADODB.Field Dim i As Integer i = 0 Try recordset = New SmallCOM.ADODB.Recordset recordset.cursorLocation( Enum( SmallCOM.ADODB.CursorLocationEnum, adUseClient ) ) recordset.lockType( Enum( SmallCOM.ADODB.LockTypeEnum, adLockBatchOptimistic ) ) recordset.open( SQLClause, activeConnection: Call DB.ConnectString ) recordset.addNew flds = recordset.fields Do Until i = UBound( Columns ) field = flds.item( Columns( i ) ) field.value( Data( i ) ) i = i + 1 Loop recordset.updateBatch recordset.close Return True End Try Catch MsgBox( Error.description ) Return False End CatchcJoops.Scripting.SQLStringArrayArrayvzSelectKSelect ( columnNames As Array, from As Joops.Scripting.SQLStringripting.SQLString008 - JOOPS Informationstechnik GmbH, Josef Springer ' 'Answer the columns "columnNames" in the table "from" of the rows matching the wh, where As Joops.Scripting.SQLString ) 'Created: 1.2.2008 - JOOPS Informationstechnik GmbH, Josef Springer ' 'Answer the columns "columnNames" in the table "from" of the rows matching the where-clause "where" '"where" is optional is used if not emty only ! 'Answer an Array of matched records (each an Array too) or an empty Array if no record matched 'Get the connection string with DB.Connection ' 'Arguments: columnNames The names of the required columns ' from The table to select ' where The optional WHERE clause or NULL ' 'Returns: Array(Array,...) Library "..\Library\Microsoft ADODB.pcl" Dim con As SmallCOM.ADODB.Connection Dim recordset As SmallCOM.ADODB.Recordset Dim columns As SmallCOM.ADODB.Fields Dim results As Array Dim record As Array Dim i As Integer Dim selectCommand As String Dim pointer As String Try con = New SmallCOM.ADODB.Connection con.open( Call DB.ConnectString ) End Try Catch MsgBox( Error.Description & ":" & Call DB.ConnectString & "Database can not be opened", , vbCritical, "Database error: Open" ) Return Null End Catch Try pointer = MousePointer( vbHourglass ) selectCommand = "SELECT " & Join( columnNames, "," ) & " FROM " & from If IsEmpty( where ) = False Then selectCommand = selectCommand & " WHERE " & where End If recordset = con.execute( selectCommand ) results = Array() While recordset.eof = False columns = recordset.fields record = Array() For i = 1 To UBound( columnNames ) Step 1 record( UBound( record ) ) = columns.item( columnNames( i - 1 ) ).value Next results( UBound( results ) ) = record recordset.moveNext Wend recordset.close con.close MousePointer( pointer ) End Try Catch MousePointer( pointer ) MsgBox( Error.Description & ":" & selectCommand, , vbCritical, "Database error: Execute" ) con.close End Catch Return resultsoArrayJoops.Scripting.SQLStringJoops.Scripting.SQLStringvzFoxproConnectStringFoxproConnectString ( dbfFiles As String ) 'Created: 1.2.2008 - JOOPS Informationstechnik GmbH, Josef Springer 'Updated: 25.2.2008 - JOOPS Informationstechnik GmbH, Josef Springer ' If a DSN has to be used, the name of the DSN is used as the connection string ' 'Get the standard connection string for a Foxpro database. dbfFiles specifies the directory containing the database files. Use ' {Microsoft Visual FoxPro Driver} or ' an ODBC-Datasource name or ' Provider=vfpoledb with the installed ODEDB-provider 'depending on the used OS. Argument dbfFiles names the directory containing .dbf-files and is ignored, if 'a DSN is used ! ' 'The first example uses the driver directly ("SourceType=" and "SourceDb=" must be given) 'The second example uses a DSN (argument "dbfFiles" is ignored. "SourceType=" and "SourceDb=" ' is defined by DSN) 'The thirt example used the OLEDB-provider. ("Data Source=" must be given) ' 'SourceDb= The source containing .dbc- and .dbf-files files (example 1 only) 'SourceType=DBF: Source contains .dbf-files. (example 1 only) 'SourceType=DBC: Source contains .dbc-files. (example 1 only) 'Data Source= Specifys the source containing .dbc- and .dbf-files (example 3 only) ' 'The first and second example works on OS lower than Vista only, the thirt example works on OS Vista too. 'Remark: The logged in user must have UAC to C:\Wains .dbc-files. 'The first and second example works on OS lower than Vista only, the thirt example works on OS Vista too. 'Remark: The logged in user must have UAC to c:\windows\ServiceProfiles\Network\Service\AppData\Local\Temp ' 'Return: String ' 1. Example: Return "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDb=" & dbfFiles ' 2. Example: Return "AMAS" ' 3. Example: Return "Provider=vfpoledb;Data Source=" & dbfFiles Return "Provider=vfpoledb;Data Source=" & dbfFiles & "\;"?Stringvz"6NbvvzZ