ODBC: SQLTables does not return data for an Access database?

  • Thread starter Brendan Reynolds
  • Start date
B

Brendan Reynolds

Richard, I have no idea what 'SQLTables' might be. Judging from the lack of
response to your other post, it looks like I'm not alone. Perhaps you might
improve your chances of getting help if you explained that.
 
R

Richard Marsden

(also posted to microsoft.public.access.odbcclientsvr but no reply so
far: problem concerns ODBC->MS Access)

I have some ODBC code that I'm testing against various underlying
databases. The code was developed against MySQL but now I'm getting
other common options to work. I'm having trouble with Access - even the
sample code (intended for Access) is giving some odd results...

My setup: Windows 2000 running Access 2000. Using ODBC to read the local
Access db.

I'm using SQLTables to find out if a table exists, and how many tables
are in the database.

But when I call SQLTables I get an "ok". The bind for the column holding
the table name is "ok" and then the first SQLFetch SQL_NO_DATA - ie. no
rows. The code works with a local MySQL database. I've copied sample
code from "ODBC 3.5 Developer's Guide" (Roger E. Sanders) - same result.

I've just tried the relevant sample program in this book. This uses the
Access Northwind sample database. No change to the code, created the
User DSN as per the book's instructions. Same result - each call to
SQLTables returns zero rows of information. But presumably it worked for
Mr. Sanders? Also I'm using a more uptodate version of
Access,Windows/etc that he uses (NT4 and Access 97 iirc).

Has anyone else come across this problem? Anything to look for? It
looks like it worked at one time?

Also a lot of the parameters for SQLGetStmtAttr appear to return
"unsupported" but I have reached the point where I can make a legitimate
test of that, yet...
 
D

Douglas J Steele

Pretty hard to comment without knowing what SQLTables does! How about
posting the code here?
 
R

Richard Marsden

Sorry, SQLTables is an ODBC function call!
It is used to query some table information. eg. what tables are available.


I must have been using ODBC too much and assumed that saying "ODBC"
implied...


Richard
 
R

Richard Marsden

Thanks for the link Brendan. I've bookmarked the next page up - it will
probably prove useful over the next few days!

Comparing what that page says to what I have in my book and the MS docs,
I tried a few options for the table types. Interestingly, the system
table option returns a list of tables, but none of the others do. Even
if I ask for all table types, I get an empty list!


I'm coding around it and marking it as "unsupported" for the
ODBC->Access combination, but this is less than ideal.
 
Top