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