VB.NET Connection to a Progress Server

Liberty

New Member
I'm new to using forums, so my apologies if I'm posting in the wrong place. I'm also new to the Progress database.

The company I work for has started switching over to 64-bit Windows 7 as we get new computers. We have a number of small VB.Net programs that we use for some standalone reporting, but need to communicate to our ERP Progress server to grab some information.

The code below was written by my manager and worked fine for XP and Windows 7 32-bit, but will not make the connection for 64-bit. Doesn't really give me any error message, either. The kicker is that it works fine when I run debug in Visual Studio 2008, but does not work once compiled to an .exe.

Any idea what I need to change to connect to the Progress server under 64-bit?

Dim UserID AsString = "johndoe"
Dim Password AsString = "open"
Dim AppServer AsString = "Progress-Server"
Dim PortNumber AsString = "8301"
Dim ConnectKey AsString = "AppServerDC://" & AppServer & ":" & PortNumber

Try
Me.MySession = New Session(UserID, Password, ConnectKey, LicenseType.Default)

If Me.MySession.SessionID <> ""Then
Try
Dim BAQHandler AsNew Epicor.Mfg.BO.DynamicQuery (Me.MySession.ConnectionPool)

Dim DQDD As Epicor.Mfg.BO.QueryDesignDataSet
DQDD = BAQHandler.GetByID(BAQ)
BAQHandler.AddWhereItem(DQDD, BAQ, "PartPlant", "PartNum", "=", True, PartNumber, "", "", "(", ")", "", False)

Dim DQRD AsNew Epicor.Mfg.BO.DynamicQueryDataSet

ForEach TT As DataTable In DQRD.Tables
ForEach SS As DataTable In DQDD.Tables
If SS.TableName.Trim = TT.TableName.Trim Then
TT.Merge(SS)
EndIf
Next
Next

'Loads the data into a local datatable
dsVantageTable = BAQHandler.Execute(DQRD)


Catch ex As Exception
MessageBox.Show(ex.Message)
EndTry
EndIf
Catch ex As Exception
MessageBox.Show("Error" & ex.Message)
EndTry
 

Casper

ProgressTalk.com Moderator
Staff member
Can it be that you compiled it 64 bit in stead of 32 bit? 64 bit client cannot connect to a 32 bit appserver. (Don't ask why :)). We had the same issue with our WPF front end which accidentally got compiled 64 bit.

KB P125260:
Status: Verified
SYMPTOM(s):
Error 7203 when running .NET Open Client on 64-bit environment
Could not connect to the AppServer: <message text>. (7203)
Exception:SessionPool : NoAvailableSessions[Could not connect to the
AppServer: General Error: is not a valid Win32 application. (Exception
from HRESULT: 0x800700C1). (7203) ]
Trace:progress.Open4GL.DynamicAPI.SessionPool+NoAvailableSessionsException: SessionPool : NoAvailableSessions[Could not connect to the AppServer: General Error: is not a valid Win32 application
FACT(s) (Environment):
Calling the .NET proxy from a .NET application
Using .NET 2.0 Framework
OpenEdge 10.1x
Windows 64-bit
CAUSE:
The .NET application has been compiled with the 'Any CPU' Compiler
option. It needs to be compiled with the 32-bit compiler option.
FIX:
For ASP.NET 2.0, run as a 32-bit application instead of 64-bit.
For further information about how to switch to 32-bit version of
ASP.NET, check http://support.microsoft.com/kb/894435
 
As for WIN .NET application, the /platform:x86 option for the compiler
must be set in the .NET project instead of 'Any CPU'.
For further information about how to set this compiler option in the
Visual Studio environment, check the following MSDN article:
http://msdn.microsoft.com/en-us/library/zekwfyz4(VS.80).aspx

Regards,

Casper.
 

Liberty

New Member
Thanks, Casper, but I've tried to compile it 32 bit and 64 bit. Nothing seems to work. The error I get is: "The type initializer for 'Epicor.MFG.Core.Session threw an exception." We use a Progress server with software from Epicor.
 
Top