VB / Progress Stored Procedure

Nakomis

New Member
Hi,

I have experience in MS SQL Server & VB 6 & .NET, and I'm now tring to write an App to connection to a Progress Database

In SQL, I would normally create a procedure as follows (e.g.)

CREATE PROCEDURE uspMHTest
@intParam1 integer

AS

SELECT *
FROM PMZ_TRI_DET
WHERE TRI_CODE = @intParam1

GO


The VB.NET code would then be something like

Dim conProgress As New Microsoft.Data.Odbc.OdbcConnection()
Dim drProgress As Microsoft.Data.Odbc.OdbcDataReader
Dim commProgres As New Microsoft.Data.Odbc.OdbcCommand()
Dim strResult As String
With conProgress
.ConnectionString = "DSN=xpint;HOST=it19;PORT=2513;DB=xpint;UID=SomeLogin;PWD=SomePassword"
.Open()
End With
With commProgres
.CommandType = CommandType.StoredProcedure
.CommandText = "uspMHTest"
.Parameters.Add("@intParam1", Microsoft.Data.Odbc.OdbcType.Int).Value = 600
.Connection = conProgress
End With
drProgress = commProgres.ExecuteReader
With drProgress
While .Read
strResult &= .Item(0)
End While
End With
MsgBox(strResult)


As I'm very new to progress, I'm afraid I haven't a clue where to start. I.e. How & Where do I create the stored procedure?. Also, how do I call it from VB.NET

I've managed to get a simple SELECT statement working if I put the SQL directly into the VB, and use a CommandType of Text, but any attempt I've made to create or call a stored procedure just doesn't seem to be going anywhere - I've tried to create the proc using the Procedure Editor in Data Administrator - Is this correct

If anyone could provide a simple stored proc (and how to create it!) and any VB / VB.NET client code I'd be very grateful

Cheers

Nak
 
Top