Darksnake's correct - you need to read a row before you can access the data. Quite a common thing you might want to do is go through all the rows like so:
One thing you have to be careful of (at least in SQL databases - I don't know about Access) is that you can have problems reading null values. So you might want to call reader.IsDBNull(x) (where x is the column) before using Getxxx().Code:while(reader.HasRows()) { reader.Read(); // get some data and use it }
ac
[edit]Bear in mind I use C# so the code above is probably not correct in VB[/edit]




Reply With Quote