Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only able to access certain tables

Status
Not open for further replies.

DaedalusPrime

Programmer
May 25, 2005
13
US
I'm trying to read some information in from a database to populate a bunch of textboxes in a form.

I'm using the oleDbConnection and oleDbReader classes to accomplish this. The database itself was made in Access and within Access, I can write SQL queries that are able to query any table in the database fine. However when I copy these statements into my code, only one of the tables opens up correctly.

I've checked my spelling in my SQL statements and ensured that I'm closing the database before trying to open it again but still no luck.

Thanks in advance for any help!
 
You can create Query objects in Access as you do views in MS SQL. Then in your application retrieve data accessing the query objects as you do for tables e.g:
string sql= "select * from qAssetCoveredByContract";
obislavu
 
Try simplifying your query to eliminate any typing or syntax errors. Then you can build it back up to the complexity you need.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top