Run CFront

pranciusprancius Member Posts: 12
Hello,

I have trouble to test CFront. I would like connect to database open company ...
But i have an error

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Hangs on line front.ConnectServerAndOpenDatabase

Client version is 4.00 SP2 (5.0 SP1)
           NavisionValue Data;

            String NavisionPath = "C:\\Program Files\\Microsoft Dynamics NAV\\CSIDE Client\\";
            CFrontDotNet front=new CFrontDotNet(NavisionDriverType.Sql,NavisionPath);

            int CT; // Currentt Table. Keep name short, since we need to type it in a lot

            int CR; // CurrentRecord. Keep name short, as above

           
            front.ConnectServerAndOpenDatabase("Navision", NavisionNetType.SqlDefault, "my_database", 2000, true, false,"demo", "demo");

            front.OpenCompany("Test company");

            CT = front.OpenTable(18);

            CR = front.AllocRecord(CT);

            front.FindFirstRecord(CT, CR);

            Data = front.GetFieldData(CT, CR, 2);

            NavisionText NAVText;

            NAVText = Data;

            textBox1.Text = NAVText.ToString();

            // Important: Close down Navision when finished.

            front.FreeRecord(CR);

            front.CloseTable(CT);

            front.CloseCompany();

            front.CloseDatabase();

            front.DisconnectServer();

            front.Dispose();



Any sugestion are welcome.
Thank you

Comments

  • Jorge_Torres_[MSFT]Jorge_Torres_[MSFT] Member, Microsoft Employee Posts: 29
    Which version number are you using?

    I would suggest using 4.00 SP3.
    “This posting is provided "AS IS" with no warranties, and confers no rights.”
Sign In or Register to comment.