• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading multple columns in 1 query.

 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm attaching to an Access 2000 database on a shared mapped drive and can pull 1 column in at a time through my SQL statement. I have to execute a separate SQL call for each column, which seems to be a waste. I want to be able to pull in and show all the fields in each row.
What do I do to show both / all of the columns in each row?


(I'm just trying to get a handle on this, so I know this application doesn't make sense yet....)
Thanks in Advance!
[ February 18, 2004: Message edited by: Sam Smoot ]
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This could be your problem, unless SQL Server allows this!
String SQL="SELECT FirstName LastName FROM TeamInfo";
the missing comma between FirstName and LastName.
Try changing it to
String SQL="SELECT FirstName, LastName FROM TeamInfo";
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DUHHHHHHHH!!!
That fixed it...
I gotta quit running in mixed mode and stick to one thing...
Thanks!
 
Sonny Gill
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no worries, mate.
cases like this, sometimes you can debug by trying to use PreparedStatement instead of Statement. cheers
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And if you want all the columns you can just use SELECT * FROM ...
reply
    Bookmark Topic Watch Topic
  • New Topic