RE: Calling UniData subroutines via OLEDB
Steven, Sorry I don't know this for UniData, but I posting just in case it may use similar techniques to those under UniVerse. On UniVerse you can use the CALL statement (that's CALL as in SQL CALL not a BASIC CALL) CALL subroutine(Args) MyCmd.Text = 'CALL MySub(1)' (NOTE : This is considered by ADO to be an SQL command, not a stored procedure). This returns either: A) any printed output as a single column named 'PRINTED OUTPUT', or B) you can execute native uvSQL commands using SQLExecDirect and capture the result into a system variable named @HSTMT. This then passes the results back as an ADO RowSet. Regards, Brian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 26 April 2004 23:36 To: [EMAIL PROTECTED] Subject: Calling UniData subroutines via OLEDB Hello We're struggling through the IBM documentation to figure out how to call a subroutine on UniData via OLEDB. (The OLDB.pdf) I'm hoping some one can point us in the direction of some additional documentation or code examples. I've begun searching in the archives, but only limited success so far. thanks in advance for any info. Steven Covey Senior Business Analyst JIA, Inc. (Jenkon) [EMAIL PROTECTED] -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users This email was checked by MessageLabs SkyScan before entering Microgen. This email was checked on leaving Microgen for viruses, similar malicious code and inappropriate content by MessageLabs SkyScan. DISCLAIMER This email and any attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information. In the event of any technical difficulty with this email, please contact the sender or [EMAIL PROTECTED] Microgen Information Management Solutions http://www.microgen.co.uk -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users
Re: Calling UniData subroutines via OLEDB
Steven, here is a simple VB test application. Set up qmilk or whatever in uci.config Private Sub cmdConnect_Click() On Error GoTo ErrorTrap Dim strConnect As String Dim sDSN As String, sAccount As String Dim sUser As String, sPword As String Dim time1 As Single, time2 As Single Set UADODB = New ADODB.Connection sDSN = "qmilk" sAccount = "QMILK" sUser = "jak" sPword = "noddy" time1 = Timer With UADODB '.Provider = "Informix.UniOLEDB" ' this worked under 9.6 .Provider = "IBM.UniOLEDB" strConnect = "DATA SOURCE=" & sDSN & "; " & _ "Location=" & sAccount & "; " & _ "USER ID=" & sUser & "; " & _ "PASSWORD=" & sPword & "; " .CursorLocation = adUseClient .ConnectionString = strConnect .ConnectionTimeout = 50 .Open End With time2 = Timer - time1 lblConnect.Caption = Round(time2) & " seconds to connect" txtResult.Text = "connected" Exit Sub ErrorTrap: MsgBox "Error: " & Err.Number & " - " & Err.Description & vbCrLf & _ "Source: " & Err.Source & vbCrLf & vbCrLf & _ "Unable to connect! Aborting." End Sub Private Sub cmdDisconnect_Click() On Error GoTo ErrorTrap UADODB.Close txtResult.Text = "disconnected" Unload Me Exit Sub ErrorTrap: MsgBox "Error: " & Err.Number & " - " & Err.Description & vbCrLf & _ "Source: " & Err.Source & vbCrLf & vbCrLf & _ "Unable to connect! Aborting." End Sub Private Sub Command1_Click() On Error GoTo ErrorTrap Set rstFiles = UADODB.Execute("SELECT SUPPLIER FROM MPSUPPLIER;") lstTables.Clear ' load a listbox If Not rstFiles Is Nothing Then rstFiles.MoveFirst Do Until rstFiles.EOF lstTables.AddItem rstFiles.Fields.Item(0) rstFiles.MoveNext Loop rstFiles.Close End If Set rstFiles = Nothing lstTables.ListIndex = 0 ' load a datagrid Set dgTest.DataSource = UADODB.Execute("SELECT SUPPLIER, NAME FROM MPSUPPLIER;") Exit Sub ErrorTrap: MsgBox "Error: " & Err.Number & " - " & Err.Description & vbCrLf & _ "Source: " & Err.Source & vbCrLf & vbCrLf & _ "Failure to execute! Aborting." End Sub jak - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 27, 2004 8:06 AM Subject: Calling UniData subroutines via OLEDB > Hello > > > > We're struggling through the IBM documentation to figure out how to call a > subroutine on UniData via OLEDB. (The OLDB.pdf) I'm hoping some one can > point us in the direction of some additional documentation or code examples. > I've begun searching in the archives, but only limited success so far. > > > > thanks in advance for any info. > > > > Steven Covey > > Senior Business Analyst > > JIA, Inc. (Jenkon) > > [EMAIL PROTECTED] > > > > -- > u2-users mailing list > [EMAIL PROTECTED] > http://www.oliver.com/mailman/listinfo/u2-users -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users