Public Class frmCFront Const SERVER_NAME As String = "PC001799\SQLDEV" Const DATABASE_NAME As String = "GAPI5" Const COMPANY_NAME As String = "Guardian Automotive Products" Const TBL_Customer As Integer = 18 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim CFR As Microsoft.Navision.CFront.CFrontDotNet Dim iTable As Integer, iRec As Integer Dim navtxtName As Microsoft.Navision.CFront.NavisionText Microsoft.Navision.CFront.CFrontDotNet.DriverType = _ Microsoft.Navision.CFront.NavisionDriverType.Sql CFR = Microsoft.Navision.CFront.CFrontDotNet.Instance Try CFR.ConnectServerAndOpenDatabase(SERVER_NAME, _ Microsoft.Navision.CFront.NavisionNetType.SqlDefault, _ DATABASE_NAME, 10000, False, True, "", "") CFR.OpenCompany(COMPANY_NAME) iTable = CFR.OpenTable(TBL_Customer) iRec = CFR.AllocRecord(iTable) ' Set filter on a "Customer"."No." CFR.SetFilter(iTable, CFR.FieldNo(iTable, "No."), "=2504") ' Find the first record CFR.FindFirstRecord(iTable, iRec) ' Obtain "Customer"."Name" navtxtName = CFR.GetFieldData(iTable, iRec, CFR.FieldNo(iTable, "Name")) MsgBox(navtxtName.ToString) CFR.FreeRecord(iRec) CFR.CloseTable(iTable) CFR.CloseCompany() CFR.CloseDatabase() CFR.DisconnectServer() Catch ex As Exception MsgBox(ex.Message) Finally CFR.Dispose() CFR = Nothing End Try End Sub End Class