VB.NET Epicor BAQ VS Connection to a Progress Server

转自:http://www.progresstalk.com/threads/vb-net-connection-to-a-progress-server.118412/
感谢分享......同时适用C#

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 As String = "johndoe"
Dim Password As String = "open"
Dim AppServer As String = "Progress-Server"
Dim PortNumber As String = "8301"
Dim ConnectKey As String = "AppServerDC://" & AppServer & ":" & PortNumber

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

If Me .MySession.SessionID <> "" Then
Try
Dim BAQHandler As New 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 As New Epicor.Mfg.BO.DynamicQueryDataSet

For Each TT As DataTable In DQRD.Tables
For Each SS As DataTable In DQDD.Tables
If SS.TableName.Trim = TT.TableName.Trim Then
TT.Merge(SS)
End If
Next
Next

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


Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
Catch ex As Exception
MessageBox.Show( "Error" & ex.Message)
End Try
 

猜你喜欢

转载自blog.csdn.net/huanglin529/article/details/72779129
今日推荐