Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Flat file or backend.mdb file ...vb6

Posted on 2004-10-21
15
Medium Priority
?
887 Views
Last Modified: 2008-03-10
What are the advantages or disadvantages (or limitations) of a flat file compared to a backend mdb file?  In this case there is no need to built a relationship between the tables.  Could you also give me a sample of a flat file where I can access from a vb6 form to store or retrieve data?

Thanks
0
Comment
Question by:Mike Eghtebas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
  • +2
15 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 12372837
go with the database you get quickness,efficiency and structure.

0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12372842
Depends on how many and what kind of data you want to store.


1. access only support up to 2 GB file.
2. fast query using access
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12372847
however for flat file you can go up to 4 GB (NTFS)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 48

Expert Comment

by:Mikal613
ID: 12372851
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 12372869
Actually you can go much more than 4 GB on NTFS with a flat file.
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12372909
e.g  the file for one record you may have to go through the whole file
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12373083
>>Actually you can go much more than 4 GB on NTFS with a flat file.

You are right about this

http://www.ntfs.com/ntfs_vs_fat.htm
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12373107
4gb of file info

sllllooooooowwwwww
0
 
LVL 48

Assisted Solution

by:Mikal613
Mikal613 earned 800 total points
ID: 12373124
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 12374214
Thank you all,

I have few KB data.  I am using access mdb right now but would like to get rid of it.  I need code to make my first ever flat file (detailed instruction is appreciated).  I don't need structure (if it means relational between the tables, they are not related at all).

Sorry for the delay.

Mike
0
 
LVL 4

Accepted Solution

by:
AjithJose earned 1200 total points
ID: 12374757
The main advantages of flat file are:

No runtime files required to access the flat file.
As you can read/write directly from VB, operations will be faster than databases
You can use a simple xml file or ini file as flat file

The disadvantages are:

You have to rewrite the entire file for a simple insert operation. Or you have to use complex structures/algorithms to find the records in order. You may have to perform a full rewrite to update a single record, if it is the first one.

Operations like sort, search,index will require much more time than databases.

Advantages of databases are:

They hold the entire data (ie, tables) together. Storage is highly optimized. Conventional data operations such as sort, index, search are very fast. You dont have to worry about anything regarding internal storage of database, database runtime files will handle everything for you.

Disadvantages are:

They require heavy runtime files, for Access, you have to install  ADO/DAO runtimes. They are almost >5MB in size. This makes your install program much bigger size.


Conclusion:

For small amounts of data,  (max records < 500). You can use flat files. Else use database such as mdb


0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 12374910
Hi  AjithJose,

Thank you for good information to help me understand flat files.  I have only few small tables, each with 10 records to 50 records with no more than 5 fields each.  I have Text, Bollean, Number, and Memo fields.

Could you give me some code to get started with?  I will keep this the flat files in a folder in folder in C drive.  It will be nice to make them hidden and/ or password protect them.

Regards,

Mike
0
 
LVL 48

Assisted Solution

by:Mikal613
Mikal613 earned 800 total points
ID: 12375065
dim FilPntr as long

FilPntr  =  Freefile()

open "c:\hi.txt" for append as #FilPntr  

write #FilPntr,  txtfee.text,Boolean,number,memo

close #FilPntr  
0
 
LVL 4

Assisted Solution

by:AjithJose
AjithJose earned 1200 total points
ID: 12375386

Read this article:  http://www.quantumcloud.com/forum/viewtopic.php?t=268

You will get a better understanding of the flat file

Please explain the Memo field you are using:

If you want to store multiple lines of text as memo, then you can not store in plain text file as in the above example by Mikal. You have to use store in user defined data types

These urls will certainly help you
How to Work with Random Access Files:  http://support.microsoft.com/?kbid=150700

Contact manager using Random Access Files: www.freevbcode.com/ShowCode.asp?ID=2673

Sequential Access files in VB tutorial: http://www.officecomputertraining.com/vbtutorial/tutpages/decide.asp


0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 12376777
Mainly I wasn't sure the final user will have accessinstalled, therefore, I was looking for an alternate way to handle backend issue.  I will give a try to the above solutions later on.  At this point, I am using an access file to do the work (because I am certain the will have excel on their machine, if it is important to have it installed).

Regards to all,

Mike
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question