I get this error when I run my program, please help
I already input the right user and password but still get the error.
And after I checked the program, It can run well in Windows 10 but get the error above if run in Windows Server.
and this is my script :
'Accpac Session (Must be created)
Dim session As ACCPAC.Advantage.Session
Dim mDBLinkCmpRW As ACCPAC.Advantage.DBLink
session = New ACCPAC.Advantage.Session()
session.Init("", "XX", "XX1000", "65A")
session.Open("ADMIN", "ADMIN", "TESTDT", DateTime.Today, 0)
mDBLinkCmpRW = session.OpenDBLink(ACCPAC.Advantage.DBLinkType.Company, ACCPAC.Advantage.DBLinkFlags.ReadWrite)
'Declare GL Entry View
Dim GLBATCH1batch As ACCPAC.Advantage.View
Dim GLBATCH1header As ACCPAC.Advantage.View
Dim GLBATCH1detail1 As ACCPAC.Advantage.View
Dim GLBATCH1detail2 As ACCPAC.Advantage.View
Dim GLPOST2 As ACCPAC.Advantage.View
'Open GL Entry View
GLBATCH1batch = mDBLinkCmpRW.OpenView("GL0008")
GLBATCH1header = mDBLinkCmpRW.OpenView("GL0006")
GLBATCH1detail1 = mDBLinkCmpRW.OpenView("GL0010")
GLBATCH1detail2 = mDBLinkCmpRW.OpenView("GL0402")
GLPOST2 = mDBLinkCmpRW.OpenView("GL0030")
'Compose GL Entry View
GLBATCH1batch.Compose({GLBATCH1header})
GLBATCH1header.Compose({GLBATCH1batch, GLBATCH1detail1})
GLBATCH1detail1.Compose({GLBATCH1header, GLBATCH1detail2})
GLBATCH1detail2.Compose({GLBATCH1detail1})
GLBATCH1batch.RecordCreate(ViewRecordCreate.Insert)
GLBATCH1batch.Fields.FieldByName("PROCESSCMD").SetValue("1", False) ' Lock Batch Switch
GLBATCH1header.Fields.FieldByName("BTCHENTRY").SetValue("00000", False) ' Entry Number
GLBATCH1header.RecordCreate(ViewRecordCreate.DelayKey)
GLBATCH1batch.Fields.FieldByName("BTCHDESC").SetValue("Merchant Settlement 20180620", False) ' Description
GLBATCH1header.Fields.FieldByName("DOCDATE").SetValue("2018, 6, 20", False) ' Document Date
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000003", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("220101", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("-7364878", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000004", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("220101", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("0", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000005", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("401001", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("47541", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000006", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("211000", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("4754", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000007", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("151009", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("-951", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000008", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("202001", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("7313534", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1header.Fields.FieldByName("JRNLDESC").SetValue("PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1header.Insert()
I already input the right user and password but still get the error.
And after I checked the program, It can run well in Windows 10 but get the error above if run in Windows Server.
and this is my script :
'Accpac Session (Must be created)
Dim session As ACCPAC.Advantage.Session
Dim mDBLinkCmpRW As ACCPAC.Advantage.DBLink
session = New ACCPAC.Advantage.Session()
session.Init("", "XX", "XX1000", "65A")
session.Open("ADMIN", "ADMIN", "TESTDT", DateTime.Today, 0)
mDBLinkCmpRW = session.OpenDBLink(ACCPAC.Advantage.DBLinkType.Company, ACCPAC.Advantage.DBLinkFlags.ReadWrite)
'Declare GL Entry View
Dim GLBATCH1batch As ACCPAC.Advantage.View
Dim GLBATCH1header As ACCPAC.Advantage.View
Dim GLBATCH1detail1 As ACCPAC.Advantage.View
Dim GLBATCH1detail2 As ACCPAC.Advantage.View
Dim GLPOST2 As ACCPAC.Advantage.View
'Open GL Entry View
GLBATCH1batch = mDBLinkCmpRW.OpenView("GL0008")
GLBATCH1header = mDBLinkCmpRW.OpenView("GL0006")
GLBATCH1detail1 = mDBLinkCmpRW.OpenView("GL0010")
GLBATCH1detail2 = mDBLinkCmpRW.OpenView("GL0402")
GLPOST2 = mDBLinkCmpRW.OpenView("GL0030")
'Compose GL Entry View
GLBATCH1batch.Compose({GLBATCH1header})
GLBATCH1header.Compose({GLBATCH1batch, GLBATCH1detail1})
GLBATCH1detail1.Compose({GLBATCH1header, GLBATCH1detail2})
GLBATCH1detail2.Compose({GLBATCH1detail1})
GLBATCH1batch.RecordCreate(ViewRecordCreate.Insert)
GLBATCH1batch.Fields.FieldByName("PROCESSCMD").SetValue("1", False) ' Lock Batch Switch
GLBATCH1header.Fields.FieldByName("BTCHENTRY").SetValue("00000", False) ' Entry Number
GLBATCH1header.RecordCreate(ViewRecordCreate.DelayKey)
GLBATCH1batch.Fields.FieldByName("BTCHDESC").SetValue("Merchant Settlement 20180620", False) ' Description
GLBATCH1header.Fields.FieldByName("DOCDATE").SetValue("2018, 6, 20", False) ' Document Date
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000003", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("220101", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("-7364878", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000004", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("220101", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("0", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000005", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("401001", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("47541", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000006", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("211000", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("4754", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000007", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("151009", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("-951", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1detail1.RecordCreate(ViewRecordCreate.NoInsert)
GLBATCH1detail1.Fields.FieldByName("TRANSNBR").SetValue("-000000008", False) ' Transaction Number
GLBATCH1detail1.Fields.FieldByName("ACCTID").SetValue("202001", False) ' Account Number
GLBATCH1detail1.Fields.FieldByName("TRANSDESC").SetValue("Merchant settlement - PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1detail1.Fields.FieldByName("TRANSREF").SetValue("PAYOUT_20180620_20180621031003", False) ' Reference
GLBATCH1detail1.Fields.FieldByName("SCURNAMT").SetValue("7313534", False) ' Source Currency Amount
GLBATCH1detail1.Insert()
GLBATCH1header.Fields.FieldByName("JRNLDESC").SetValue("PT INOVASI DAYA SOLUSI", False) ' Description
GLBATCH1header.Insert()