Open Random Access File and Populate Worksheet

  • Status: Closed
  • Prize: $60
  • Entries Received: 2
  • Winner: MuradMurad

Contest Brief

I need to open the attached random access file RawMats.dat in a MS Excel worksheet.
I will then modify some data add some new records/rows and save it back to the original file.
The winner will have the clearest and most understandable commented code.

(If you do not want others to see your entry upload it elsewhere and send me a private message - I do not want to seal this contest)

The Random Access fields of the RawMats.dat file and program flow.....

Type FileRawMaterials in .BAS module (**see below)

Dim RM As FileRawMaterials

Open "RawMats.dat" For Random As #22 Len = 5120

For i = 1 To LastRecord ' (there are currently 625 records)

RecNo = i

Get #22, RecNo, RM 'Get the random file


Next i 'next RecNo

Close #22

'// Make some changes if required e.g. RM-Code = "5-ABCD1234" (a new code)
'// Put #22, RecNo ' Save changes

'**Raw Materials File 'Length 5120

Type FileRawMaterials'
Rec As String * 6 ' Record Or RecNo.
PicFile As String * 8
RemarksFile As String * 8
UniqueRef As String * 16
DBaseAroma As Integer
DBaseFlavour As Integer
DBaseProfessional As Integer
DBaseFree As Integer
DBasePW As Integer
DBaseFormats As Integer
DBaseUser As Integer
DBaseExp1 As Integer
DBaseExp2 As Integer
ArtPrice As Currency '8
DcCode As Integer '2
Artical As String * 50
Reference As String * 20
Order As String * 1
Class(27) As Integer
CLass2 As String * 4
Classification As String * 25
BriefDescription As String * 50
ClassFunction As String * 25
ClassVap As Single
Syn As String * 1050
Odour As String * 1050
Impact As Single
ClassHr As Single
Therapy As String * 1050
Perfume(21) As Integer
Flavour(21) As Integer
RemarkFra(21) As String * 15
RemarkFla(21) As String * 15
T_N As String * 4
Hour As Single
Heat As String * 40
DisColour As String * 40
pHMin As Single
pHMax As Single
DoseFlaMax As Single
DoseFlaMin As Single
ClassFla As Single
ClassFra As Single
DoseFraMax As Single
DoseFraMin As Single
State As String * 80
CHO(6) As Integer
MolFormula As String * 24
MW As Single
SG As Single
SGMax As Single
RI As Single
RIMax As Single
Rotat As Single
RotatMax As Single
FP As Single
FPMax As Single
MP As Single
MPMax As Single
BP As Single
BPMax As Single
SolWater As Single
SolEtOH As Single
SolPG As Single
SolFixOil As Single
SolDPG As Single
SolBB As Single
SolBA As Single
SolDEP As Single
CasNo As String * 30
Tarif As String * 7
NaTid As String * 16
IFRA As String * 10
RIFM As String * 1
CoE As String * 5
EEC As String * 1
FDA As String * 7
FEMA As String * 4
FCC As String * 1
SafetyFlagEx1 As String * 1
SafetyFlagEx2 As String * 1
SafetyFlagEx3 As String * 1
Safty As String * 200
RtPolar1 As Single
RtPolar2 As Single
RtPolar3 As Single
RtPolar4 As Single
RtNonPolar1 As Single
RtNonPolar2 As Single
RtNonPolar3 As Single
RtNonPolar4 As Single
Ms1 As Integer
Ms2 As Integer
Ms3 As Integer
Ms4 As Integer
Ms5 As Integer
Refer As String * 120
GNotes As String * 120
CreatedNow As Double
PWPrice As Currency
Spare As String * 8 '(Can also use as Currency)
End Type

Recommended Skills

Employer Feedback

“Great job - very quick - modified code without a grumble - knows his stuff”

Profile image perfumervw, Thailand.

Public Clarification Board

  • edatawiz
    • 9 years ago

    Hello are you really trying to run this as project for your official use as this would make your work so complicated ... if project is what you would want to run .. this can be done with access or any other database rather using a random file .. Let me know your views

    • 9 years ago
    1. perfumervw
      Contest Holder
      • 9 years ago

      Its built into the history of the project so has to be like this, sorry.

      • 9 years ago
  • lgdelrosario
    • 9 years ago

    My entry :)

    • 9 years ago
  • edatawiz
    • 9 years ago

    Hello -

    • 9 years ago
  • edatawiz
    • 9 years ago

    Hello -

    • 9 years ago

Show more comments

How to get started with contests

  • Post your contest

    Post Your Contest Quick and easy

  • Get tons of entries

    Get Tons of Entries From around the world

  • Award the best entry

    Award the best entry Download the files - Easy!

Post a Contest Now or Join us Today!