views:

204

answers:

1

Our organization is using UniObjects for .NET but the CD seems to have gone missing. I need to figure out how to read and write to and from files in Universe. Please note the program is written in VB.NET

Dim uniSession As UniSession
Private DATABASE_IDENTIFIER As String = "uvcs"

uniSession = UniObjects.OpenSession(_hostname, _username, _password, _account, DATABASE_IDENTIFIER)

' Clear the already existing LICENCE_STATUS table
Dim nepiLicenceStatusFile As UniFile = uniSession.CreateUniFile("LICENCE_STATUS")
nepiLicenceStatusFile.Open()
nepiLicenceStatusFile.ClearFile()

' Insert new values in the LICENCE_STATUS table???
' Read values from the LICENCE_STATUS table???

I need to figure out how to insert new values, and read values from the LICENCE_STATUS table. Can anyone here help me?

+2  A: 

Firstly, you can find your manuals on Rocket's website

Here are some examples of reading/writing

' read a record "2"
Dim ar_record As UniDynArray = nepiLicenceStatusFile.Read("2")

' write back as record "2new"
nepiLicenceStatusFile.Read("2new", ar_record)

' write a random string to a record
nepiLicenceStatusFile.write("2new", "My random string")

'read a field "7" from record "2"
Dim ar_record2 As UniDynArray = nepiLicenceStatusFile.ReadField("2", 7)

' write back to field "8"
nepiLicenceStatusFile.write("2", 8)

'read number of fields (4,5,6) from record "2"
Dim lFieldSet() As Integer = {4, 5, 6}
Dim ar_record3 As UniDynArray = nepiLicenceStatusFile.ReadFields("2", lFieldSet)

' read named field "LNAME" from record "2"
Dim ar_record4 As UniDynArray = nepiLicenceStatusFile.ReadNamedField("2", "LNAME")

' read records (2, 12, 3 and 4) as unidataset
Dim sArray As String() = {"2", "12", "3", "4"}

uSet = nepiLicenceStatusFile.ReadRecords(sArray)

I'm sure you get the idea now :)

Dan McGrath