Click here to Skip to main content
15,919,879 members
Home / Discussions / Database
   

Database

 
AnswerRe: Locking Rows During Edit? Pin
Marcie Jones15-Mar-04 3:43
Marcie Jones15-Mar-04 3:43 
GeneralRe: Locking Rows During Edit? Pin
Verdant12315-Mar-04 3:52
Verdant12315-Mar-04 3:52 
Generalfill an access table with a dataset Pin
pankajdaga14-Mar-04 1:47
pankajdaga14-Mar-04 1:47 
GeneralRe: fill an access table with a dataset Pin
dishanf14-Mar-04 18:36
dishanf14-Mar-04 18:36 
GeneralRe: fill an access table with a dataset Pin
pankajdaga14-Mar-04 21:27
pankajdaga14-Mar-04 21:27 
GeneralRe: fill an access table with a dataset Pin
dishanf14-Mar-04 21:39
dishanf14-Mar-04 21:39 
GeneralCount (*) Pin
Peter Mayhew14-Mar-04 1:43
Peter Mayhew14-Mar-04 1:43 
GeneralRe: Count (*) Pin
-Dr_X-14-Mar-04 8:15
-Dr_X-14-Mar-04 8:15 
First of all, does the Log table have an primary key index, preferable an autoincrementing ID. It would be much faster as the log file table size increases to do a 'select count(ID) from log' than doing a count(*). Executing a count(*) may induce a table scan while count(ID) will only scan the primary key index.
2nd, you should probably execute a OBJdbConnection.ExecuteScalar rather than a execute. The executescalar is designed to return a single value which is what you are looking for.
Dim rowCount as object
SQLQuery = "SELECT COUNT(ID) FROM Log"
value = OBJdbConnection.ExecuteScalar(SQLQuery)
if not value is dbnull.value then 
  'Make sure you didn't receive a Null from the database. 
  'If not it should be an int or int32. Can't remember which one is actually returned.
  Response.Write(value.tostring)
end if
The above is not tested but you should get the idea.

Michael

I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
GeneralRe: Count (*) Pin
Peter Mayhew14-Mar-04 9:30
Peter Mayhew14-Mar-04 9:30 
GeneralRe: Count (*) Pin
Peter Mayhew14-Mar-04 9:56
Peter Mayhew14-Mar-04 9:56 
GeneralRe: Count (*) Pin
-Dr_X-14-Mar-04 10:17
-Dr_X-14-Mar-04 10:17 
GeneralRe: Count (*) Pin
-Dr_X-14-Mar-04 10:06
-Dr_X-14-Mar-04 10:06 
GeneralRe: Count (*) Pin
Peter Mayhew15-Mar-04 4:48
Peter Mayhew15-Mar-04 4:48 
GeneralRe: Count (*) Pin
dishanf14-Mar-04 18:39
dishanf14-Mar-04 18:39 
GeneralRe: Count (*) Pin
Peter Mayhew15-Mar-04 4:52
Peter Mayhew15-Mar-04 4:52 
GeneralRe: Count (*) Pin
Peter Mayhew15-Mar-04 10:12
Peter Mayhew15-Mar-04 10:12 
GeneralRe: Count (*) Pin
-Dr_X-15-Mar-04 11:49
-Dr_X-15-Mar-04 11:49 
Generalsql statements Pin
pnpfriend12-Mar-04 9:02
pnpfriend12-Mar-04 9:02 
GeneralRe: sql statements Pin
Henrik Stuart12-Mar-04 9:15
Henrik Stuart12-Mar-04 9:15 
GeneralRe: sql statements Pin
dishanf14-Mar-04 18:42
dishanf14-Mar-04 18:42 
GeneralRe: sql statements Pin
Arjan Einbu14-Mar-04 21:00
Arjan Einbu14-Mar-04 21:00 
GeneralRecordset dim problem Pin
Fabio Panzavolta12-Mar-04 3:39
Fabio Panzavolta12-Mar-04 3:39 
GeneralRe: Recordset dim problem Pin
l a u r e n18-Mar-04 18:54
l a u r e n18-Mar-04 18:54 
GeneralCreating a new access database using ADO.NET Pin
pankajdaga11-Mar-04 2:20
pankajdaga11-Mar-04 2:20 
GeneralRe: Creating a new access database using ADO.NET Pin
Mike Ellison11-Mar-04 6:15
Mike Ellison11-Mar-04 6:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.