Inserting Data into MSACCESS DB

Results 1 to 2 of 2

Thread: Inserting Data into MSACCESS DB

  1. #1
    Join Date
    Dec 1969

    Default Inserting Data into MSACCESS DB

    Hello<BR><BR>This is what I want.<BR><BR>I had created a tree menu and its working fine. <BR>The ACCESS Database is as below :<BR>Main category -level 1<BR>Child below it - level 2<BR>Child for child - level 3<BR><BR>All this works fine at initial stages but the real problem comes here.<BR><BR>Say iam having 20 main categories, each has 10 child. Now at later stages, i am adding a Child under 1 of the categories, Iam not able to insert it inbetween the data. <BR><BR>As I have a webbabsed database adminstrator interface, I want to insert the newdata at where I wish so that the tree works fine. Otherwise the tree structure gets confused.<BR><BR>So kindly advice me how this can be possible -<BR>Inserting data at our wish in a Database table.-<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default Understanding database fundamentals

    Database, in general, have NO NOTION of "ordering" of data.<BR><BR>In fact, an efficient database will *NOT* keep data in the order that you entered it.<BR><BR>Suppose you add 10 records. Then you delete 2. Then you add 3 more records.<BR><BR>An efficient database would put the first 2 of the "more" records into the slots previously occupied by the two records you deleted and only then add the the third "more" record to the end of the table.<BR><BR>When you want data in a particular order, *YOU* must provide for it and *YOU* must ask for that order.<BR><BR>So, for example, you can ask for records from a table ordered, in alphabetical order, by the contents of some field.<BR><BR>Or you can ask that the data be ordered by date order, again based on some field in the data.<BR><BR>And you can ask for the data in reverse order, of course.<BR><BR>But what you *can&#039;t* (in general!) do is ask for data in the order that you added it to the table. If you *happen* to get it in that order, you are lucky. It probably means that either (a) you have not deleted any data or (b) you designated one field as the Primary Key of the table and the DB you are using returns the data in Primary Key order by default.<BR><BR>SO...<BR><BR>Time to rethink your design. How will *YOU TELL* the DB that this new Child you are adding goes in the middle of some of the Child records that are already there? Will you do it alphabetically? Numerically? What?<BR><BR>But YOU have to design it. And then YOU have to ask for that ordering, using a SQL "ORDER BY" clause in your query.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts