Update data in files

o-mheien@hdsoftware.no

Active member
Joined
Feb 6, 2007
Messages
27
Programming Experience
10+
Hi there folks
I have been working on an application for a while now and nead data saving. I ended up in creating my own data files and just stream to it. Unfortunatly this is not a good way to do it because the file is sequential and I have to save the complete file every time.

I have tryed to use an ACCESS file many times, but it wont work. I have tryed the Starter kit "My Movie Collection" that ships with VS2005. The application starts and I can update in the window tables. Problem is that all my attempts to save to the file fails from the application. Though I can edit the records using the built in tools in VS2005.

So folks, wher's the problem? Is anyone able to compile and run the "My Movie Collection" and save to the file?

Allso, I'm a little new to the MS way of using data tables. In the DEV tools I'm used to I can do it like this:
VB.NET:
CustomerFile.CustomrNumber = 1234
Get(CustomerFile, CustomerFile.KeyCustomerNumber)
This search for a record ordered by customernumber for the customer with the given number
... or, I can scan for a sequece of records
VB.NET:
Clear(CustomerFile)
CustomerFile.RegDate = Local.SelectedDate
Set(CustomerFile.KeyRegDate)
Loop until EndOfFIle(CustomerFile)
  next(CustomerFile)
  if CustomerFile.RegDate > Local.SelectedDate
    Break
  End!if
  .... Do something with the record
End!Loop
This wil scan the file, ordered by RegDate, and the loop breaks when the RegDate is later than the selected date.
And of course, in both situations just mentioned, I can change fields and save it back:
VB.NET:
CustomerFile.LastEditedDate = Today()
Put(CustomerFile)
Is there any equivalence to the use of Access, SQL, Whatever in VB2005?

Regards
Ole M.
 
Back
Top