Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a Database (Access) that has a Table Called "Database Information" - it stores adminstrative information on the database.

Anyways - I only want the table to have one row of information and I want to keep updating that one single row.

 

So, for starters, if the table is empty (which I can test for to see the row count) then I do a simple INSERT statement to create my first row.

Now the problem is - going forward I just want to keep updating that one row/record - is there a way to specify in the statement that I am want to UPDATE row0 (the first row?)

 

Other then the typical SELECT * FROM TABLE (which should only return one row, if there is more then one something is really odd) and then getting the ID (nID) name and doing an UPDATE WHERE ID=nID (or something)... etc... sounds really inneficient.

So I thought there must be a way to specify ROW0 (the first row) - this would be much better AND if ever a second row was inserted by accident my program would still work correctly.

Any hints/thoughts would be appreciated, Thanks,

  • *Experts*
Posted

If your table has only one row, then just UPDATE without using a WHERE clause at all. That will UPDATE every row in the table, in your case just one.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...