dbTalk Databases Forums  

Idiotic problem

comp.database.ms-access comp.database.ms-access


Discuss Idiotic problem in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kevin
 
Posts: n/a

Default Idiotic problem - 10-08-2003 , 04:12 PM






I'm trying to select from an Access database in VB. There are 5
records in the table but this select will only return 1. I have no
idea why. If I add 'DISTINCT' it works correctly.
Dim rs As Recordset
sSQL = "select name from name_table"
Set rs = oDB.OpenRecordset(sSQL)
Debug.Print rs.RecordCount

Reply With Quote
  #2  
Old   
Allan Thompson
 
Posts: n/a

Default Re: Idiotic problem - 10-09-2003 , 07:30 AM






"Name" is a reserved word and should never be used for a column name; it
confuses Access because it meant to be used in other contexts, e.g.
Recordset.Name.


--
Allan Thompson
APT Associates/ FieldScope LLC
MS Office Automation / Measurement and Reporting Systems
www.fieldscope.com
860.242.4184


"Kevin" <kcorth (AT) yahoo (DOT) com> wrote

Quote:
I'm trying to select from an Access database in VB. There are 5
records in the table but this select will only return 1. I have no
idea why. If I add 'DISTINCT' it works correctly.
Dim rs As Recordset
sSQL = "select name from name_table"
Set rs = oDB.OpenRecordset(sSQL)
Debug.Print rs.RecordCount



Reply With Quote
  #3  
Old   
Kevin
 
Posts: n/a

Default Re: Idiotic problem - 10-09-2003 , 09:11 AM



kcorth (AT) yahoo (DOT) com (Kevin) wrote in message news:<eae80cc2.0310081312.5e2cc3b4 (AT) posting (DOT) google.com>...
Quote:
I'm trying to select from an Access database in VB. There are 5
records in the table but this select will only return 1. I have no
idea why. If I add 'DISTINCT' it works correctly.
Dim rs As Recordset
sSQL = "select name from name_table"
Set rs = oDB.OpenRecordset(sSQL)
Debug.Print rs.RecordCount
Actual field and table names are:

Dim rs As Recordset
sSQL = "select player_name from player_name_table"
Set rs = oDB.OpenRecordset(sSQL)
Debug.Print rs.RecordCount


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.