Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2004, 03:21 PM
Registered User
 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADO question

Hello people
what is the quikest way for your VB program to connect to a table on an an access database (using ADO) and see how many records you have -or the highest id number?
I know there must be somethign like a count. But I need a bit more detailed info.
Thanks in advance

 
Old August 27th, 2004, 02:33 AM
Authorized User
 
Join Date: Aug 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

To get the number of records you can execute the following statement:

"Select count(id) as numberRecords from TableName"

To get the highest id you can execute the following statement:

"Select max(id) as highestid from TableName"

Hope it helps

Tom.
 
Old September 1st, 2004, 04:20 PM
Registered User
 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes it did buddy thanks a million.






Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6 ADO Dynamic Data Binding Question pad Pro VB Databases 1 January 28th, 2005 10:43 PM
Ado.net performance question (SQL server vs OleDB spamp ADO.NET 1 August 2nd, 2004 10:37 AM
ADO Record Set Question virtualdave Pro VB Databases 4 February 20th, 2004 12:21 PM
Question of calling Oracle'Procedure by ADO.Net sechmet Classic ASP Databases 0 December 3rd, 2003 05:41 AM
ADO could ADO counot find the specified provider. Rob Collie Classic ASP Databases 2 June 9th, 2003 04:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.