f



How to get table names from ms access(mdb file) by using odbc library.

Hi.

I am writing a c++ program get the data from mdb file using odbc
library.
By the way, I couldn't get table list from mdb file.
i goolgled it up little bit, what i found is only using the ADO(or OLE
i'm not sure)  library and
"SELECT Name FROM MSysObjects WHERE Type In (1,4,6) AND Left([Name],
4)<>"MSYS" this query.
i already wrote a lot of part of this program so i don't want to
switch database library.
And the query gives "no read permission on 'MSysObjects' " error
message.

If you know how to get the table list from a mdb file by using odbc
library, please share your experience.

thank you.

0
jsrookie (1)
8/8/2008 8:23:17 PM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

2 Replies
604 Views

Similar Articles

[PageSpeed] 53

If you using odbc to a mdb file, then you MUST have jet installed, and 
THEREFORE you MUST also have dao installed on your machine (in fact, out of 
the box, windows xp, server 2003, vista etc DOES HAVE the jet database 
engine installed by default (thus you don't need to install anything on a 
windows computer to read mdb files.

here is a windows (vbs) script that displays all tables...you can use late 
binding in your project, and you should little trouble getting a list of 
tables using the following idea.

Set dbeng = CreateObject("DAO.DBEngine.36")
strMdbFile = "C:\Documents and Settings\Lawrence\My 
Documents\Access\ScriptExample\MultiSelect.mdb"
Set db = dbeng.OpenDatabase(strMdbFile)
for each table in db.tabledefs
   msgbox table.name
next

The above is not a vba script. Paste the above into a text document, and 
then re-name the extension as .vbs. If you double click on this file...you 
see it list the tables in the given mdb file..

So there is a table collection available after you open the mdb file as per 
above...


-- 
Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com 


0
8/9/2008 1:04:55 AM
On Aug 9, 3:04=A0am, "Albert D. Kallal" <PleaseNOOOsPAMmkal...@msn.com>
wrote:
> If you using odbc to a mdb file, then you MUST have jet installed, and
> THEREFORE you MUST also have dao installed on your machine (in fact, out =
of
> the box, windows xp, server 2003, vista etc DOES HAVE the jet database
> engine installed by default (thus you don't need to install anything on a
> windows computer to read mdb files.
>
> here is a windows (vbs) script that displays all tables...you can use lat=
e
> binding in your project, and you should little trouble getting a list of
> tables using the following idea.
>
> Set dbeng =3D CreateObject("DAO.DBEngine.36")
> strMdbFile =3D "C:\Documents and Settings\Lawrence\My
> Documents\Access\ScriptExample\MultiSelect.mdb"
> Set db =3D dbeng.OpenDatabase(strMdbFile)
> for each table in db.tabledefs
> =A0 =A0msgbox table.name
> next
>
> The above is not a vba script. Paste the above into a text document, and
> then re-name the extension as .vbs. If you double click on this file...yo=
u
> see it list the tables in the given mdb file..
>
> So there is a table collection available after you open the mdb file as p=
er
> above...
>
> --
> Albert D. Kallal =A0 =A0(Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKal...@msn.com


"Paste the above into a text document, and
then re-name the extension as .vbs."

Or save file in Notepad with quotes, like:

"TableNames.VBS" (including quotes)

will save file without .TXT extension. :)

Regards,
Branislav Mihaljev
Microsoft Access MVP
0
banem2 (43)
8/13/2008 6:12:38 AM
Reply:

Similar Artilces:

Accessing 2 tables having same name but different databases ms-access
Hi, I have an application with MS-Access as backend and JSP/ tomcat as frontend/webserver. For getting better response time(as access is very slow compared to other RDBMS's), I have split the main DB into two DB's on different disks on my server for better performance.I have kept the table names same but changed the DB names. How do I access tables from both the DB's? This is what I have done; I made different connection to the respective DB's i.e. con and con2. When I want to access data, I am using 2 result sets for retriving data from the tables, but getting no result. Here is my code: rs2_1=stmt2_1.executeQuery("select * from Requests where Status='Released' AND LoginName='"+login+"' order by Req_No"); rs=stmt.executeQuery("select * from Requests where Status='Released' AND LoginName='"+login+"' AND Req_No> 5500 order by Req_No"); So, rs & stmt are for latest records and rs2_1 & stmt2_1 correspond the records from older DB. I think, I'm forgetting some small thing but cant get it. Please advice. What do you mean "no result"? Does "next()" return false for both rs2_1 an= d rs? If you're really trying to improve response time, you should probably be ru= nning the two queries in separate threads ... but as you acknowledge, Acces= s may not have as high performance as other RDBMSs. You would also see rel= iability adv...

Create MS/ACCESS database app for non-ms/access users
Is it possible to create an MS/ACCESS database application and package it for users who do not have MS/ACCESS loaded in their PCs? I was told that this is possible, but I don't know what software is needed. Do you know? If so, please answer this post. Thanks. SueB *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Per Sue Bricker: >Is it possible to create an MS/ACCESS database application and package >it for users who do not have MS/ACCESS loaded in their PCs? > >I was told that this is possible, but...

Accessing MS ACCESS database using Data Environment
HI, I have developped a program in Visual Basic 6.0 using MS Access database. I have created all my reports through Data Environment where I have entered the location of my database file (for e.g c:\project\app\test.mdb) in the Connection properties. I have installed my application on another PC using Package & Deployment wizard. When viewing the reports on the other PC, I have to enter everytime the new location of the database. How can I solve this problem, please? nadia wrote: > HI, > I have developped a program in Visual Basic 6.0 using MS Access database. >...

How to get Graphs from MS Access and use them in MS Powerpoint
Is there any easy way how to use graphs created in MS Access 2000 in Powerpoint?Especially when I need to use about 20 of them. Is there any development in Office 2003? Oskar *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Instead of creating the graphs in Access, perhaps you should use vba either (a) to open Powerpoint from within Access and create the graph by pushing data into a Powerpoint template of your own design or (b) start Powerpoint and open the Access database in code and pull the data into a graph. Eith...

Using Iseries Access ODBC Driver with MS ACCESS 2003
When Trying attaching databases into MsAccess2003 using Iseries Access ODBC Driver (I'm in OS400 v5r2) I get an error message according to which the duration of connection is too long and so I can't attach the database although I got the list of the tables in the library I specified. Can anyone help me ? Thanks in advance. The timeout to dispay de data is small. You need to increase this timeout. The problem can occur when the tables are very very very (but very) big. "Bertrand Bard" <bbard@dehon.com> escribi� en el mensaje news:d01a5cc.0404280030.58f11d3e@posting.go...

Re: How to access automatically in SAS a MS Access table name
i am not sure if SAS will support long file name if you use libname. a workaround is to use passthrough. On Jan 16, 2008 12:31 PM, JKamgang@Yahoo.com <JBKamgang@gmail.com> wrote: > Dear All, > > > > Happy New Year , > > > > Please, I need your help in figuring out how to access in SAS a MS > Access > table name which has more than 32 characters. As this program merges 5 > databases, I need to have almost everything automated. That's why I > don't want to rename manually the table names. > > > > Please find the program below. > > > > Thanks in advance for your kind assistance, > > > > Jean Baptiste > > > > The program: > > - - - > > > > options VALIDVARNAME=ANY ; > > libname DBsource access 'S:\Data > Management\External\Projects\MTCT-Plus\MTCT-Plus November 2007 > Data\Programs\Data\MTCT-PlusData All.mdb'; > > /* Creating the Pediatric HIV result information additional */ > > > > data* pedResultadd ; > > set dbsource.'tblInfantHIVTestResultsAdditional'n (keep = > > testid studyid labid i2 i2_da i2_mo i2_yr i2a i2b i2text > > ); > * > > run*; > > - - - The log - - > > 1636 > > 1637 /* Creating the Pediatric HIV result information additional */ > > 1638 > > 1639 data pedResultadd ; > > 1640 set dbsource.'tblInfantHIVTestResultsAdditional...

accessing MS Access database fila via ODBC problem
Hi! I'm trying to connect to a MDB file via ODBC like this: char *DSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\dev-cpp\\test\\1.mdb"; SQLAllocEnv(&env); SQLAllocConnect(env, &hdbc); SQLBrowseConnect(hdbc, (UCHAR*)DSN, strlen(DSN), (UCHAR*)buf, BUF_SIZE, (SQLSMALLINT*)&rcvlen); The function SQLBrowseConnect fails and SQLGetDiagRec returns "IM001 Driver does not support this function" Can anyone help me? Thanks! David On S...

accessing ms access via ODBC without Microsoft Access
Hi, If I have a computer without Microsoft Access installed but with an ODBC connection to a .mdb file - can I still access the 'database' via ODBC? thanks Tim <timasmith@hotmail.com> wrote in message news:1145206985.433826.106120@i40g2000cwc.googlegroups.com... > Hi, > > If I have a computer without Microsoft Access installed but with an > ODBC connection to a .mdb file - can I still access the 'database' via > ODBC? Yes, provided you are running a program prepared in a language that supports ODBC and have installed an ODBC driver on that user'...

How to get the name of selected table in MS access
I&nbsp;am using MS access database. If I select any particular table in access DB, is it possible to get that table name in Labview? In short, I want to display the name of table which is selected in Access on front panel. &nbsp;Also, same way I want to display the name of field in table, selected in DB. Is it practically possible?? Thanks for ur help in advance ...

Re: How to access automatically in SAS a MS Access table name #3
Jean - Unfortunately you are stuck - SAS only allows dataset names up to 32 bytes long - using name literals or conventional names. Defining short-named queries of your tables within MSAccess is a very good idea. The SAS libname engine will read the queries as tables and it doesn't necessitate changing your table names. Paul Choate DDS Data Extraction (916) 654-2160 -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of JKamgang@Yahoo.com Sent: Wednesday, January 16, 2008 9:32 AM To: SAS-L@LISTSERV.UGA.EDU Subject: How to access automatically in SAS a MS Access table name which has more than 32 characters? Dear All, Happy New Year , Please, I need your help in figuring out how to access in SAS a MS Access table name which has more than 32 characters. As this program merges 5 databases, I need to have almost everything automated. That's why I don't want to rename manually the table names. Please find the program below. Thanks in advance for your kind assistance, Jean Baptiste The program: - - - options VALIDVARNAME=ANY ; libname DBsource access 'S:\Data Management\External\Projects\MTCT-Plus\MTCT-Plus November 2007 Data\Programs\Data\MTCT-PlusData All.mdb'; /* Creating the Pediatric HIV result information additional */ data* pedResultadd ; set dbsource.'tblInfantHIVTestResultsAdditional'n (keep = testid studyid labid i2 i2_da i2_mo i2_yr i2a i2b i2text ); * run...

How to access automatically in SAS a MS Access table name which has more than 32 characters?
Dear All, Happy New Year , Please, I need your help in figuring out how to access in SAS a MS Access table name which has more than 32 characters. As this program merges 5 databases, I need to have almost everything automated. That's why I don't want to rename manually the table names. Please find the program below. Thanks in advance for your kind assistance, Jean Baptiste The program: - - - options VALIDVARNAME=ANY ; libname DBsource access 'S:\Data Management\External\Projects\MTCT-Plus\MTCT-Plus November 2007 Data\Programs\Data\MTCT-PlusData All.mdb'; /* Creating the Pediatric HIV result information additional */ data* pedResultadd ; set dbsource.'tblInfantHIVTestResultsAdditional'n (keep = testid studyid labid i2 i2_da i2_mo i2_yr i2a i2b i2text ); * run*; - - - The log - - 1636 1637 /* Creating the Pediatric HIV result information additional */ 1638 1639 data pedResultadd ; 1640 set dbsource.'tblInfantHIVTestResultsAdditional'n (keep = --------------------------------------------- 211 ERROR 211-185: Invalid data set name. 1641 1642 testid studyid labid i2 i2_da i2_mo i2_yr i2a i2b i2text 1643 ); Jean Baptiste, --- Jean Baptiste KAMGANG, Lead Data Manager - CDC Cameroon US Centers for Disease Control and Prevention Mutengene, SouthWest Province Cameroon, Africa E mail: JBKamgang@cm.cdc.gov. Tel: + 237 3 335 1690 Fax: + 237 3 335 1692 Cell: + 237 9 984 79 14 --- .. Ca...

Re: How to access automatically in SAS a MS Access table name #2
Hi Jean, It looks like your problem is that you've got a quote in a table name: Additional'n=20 If it is possible to rename that table, that might work. =20 Also, if you use the import feature in SAS, it will write code for you = that you can save and put in a program- you might try that to see if it = can handle this kind of file name. I'd rename the table in Access, = though- a quote in a table name is likely to contiously cause you = problems. -Mary ----- Original Message -----=20 From: JKamgang@Yahoo.com=20 To: SAS-L@LISTSERV.UGA.EDU=20 Sent: Wednesday, January 16, 2008 11:31 AM Subject: How to access automatically in SAS a MS Access table name = which has more than 32 characters? Dear All, Happy New Year , Please, I need your help in figuring out how to access in SAS a MS Access table name which has more than 32 characters. As this program merges 5 databases, I need to have almost everything automated. That's why I don't want to rename manually the table names. Please find the program below. Thanks in advance for your kind assistance, Jean Baptiste The program: - - - options VALIDVARNAME=3DANY ; libname DBsource access 'S:\Data Management\External\Projects\MTCT-Plus\MTCT-Plus November 2007 Data\Programs\Data\MTCT-PlusData All.mdb'; /* Creating the Pediatric HIV result information additional */ data* pedResultadd ; set dbsource.'tblInfantHIVTest...

Possible to keep MS Access interface and migrate the MS Access to MS SQL Server?
Hello all Would it be possible to migrate the MS Access 2000 to MS SQL Server 2000? My application is using MS Access 2000 as database and as user interface such as forms. Now, I want to migrate the backend database from MS Access 2000 to MS SQL Server 2000. However, I want to keep the MS Access 2000 interface. Would it be possible? If I migrate the MS Access to SQL Server, would the queries, back-end VBA, macro, tables and forms be affected? Do I need to change the MS Access data type to SQL server supported data type? Which tool I can use to do the migration? Upsizing wizard or exporting...

MS-Access, ODBC access with Visual C++ 6.0, and external actions on database
[was redirected here] I have a problem that I can distill down to the following. 1/ A Visual C++ 6.0 program connects to a MS Access database using an ODBC connection and sleeps for a long time. The connection takes all defaults and uses CDatabase::useCursorLib in the OpenEx command. 2/ The database is well over 400MB large with over 200 tables and is compacted. 3/ Another process starts a winzip on that database that takes about 45 to 60 seconds to complete (wzzip -a -ex aaa.zip aaa.mdb). 4/ The Windows Task Manager shows 100s of MBs of available memory being consumed....

How to: External Tables attached directly to a MS Access mdb file???????
I only find information connecting Oracle external tables to data files. But I dont want to transfer data to files instead I want directly transfer data to oracle from Access. I do not know how to change the syntax of the below External table binding CREATE TABLE city_populations_ext ( city_name VARCHAR(9), pop_1990 NUMBER, pop_2000 NUMBER ) ORGANIZATION EXTERNAL ( TYPE oracle_loader DEFAULT DIRECTORY census_data ACCESS PARAMETERS ( RECORDS FIXED 20 LOGFILE census_data: 'city_populations.log' BADFILE census_data: 'city_populations.bad' FIELDS MISSING FIELD VALUES ARE NULL ( city_name (1:10) CHAR(9), pop_1990 (11:15) INTEGER EXTERNAL(4), POP_2000 (16:20) INTEGER EXTERNAL(4) ) ) LOCATION ('city_populations.dat') ) PARALLEL 4 REJECT LIMIT UNLIMITED; <gajaya1@netscape.net> wrote in message news:ef6582c0.0312121321.3aa2e521@posting.google.com... > I only find information connecting Oracle external tables to data > files. But I dont want to transfer data to files instead I want > directly transfer data to oracle from Access. I do not know how to > change the syntax of the below External table binding I'm not precisely sure what you're asking, but external tables are only a way in Oracle to read text files as though they were regular tables. Text is (currently) the only source, and it is not poss...

Import MS Office Excel Comma Separated Values Files into a MS Access 2003 database
Hi, I have been tasked with Importing MS Office Excel Comma Separated Values Files into a MS Access 2003 database. These files were exported from a DB2 database.I have also been given the DDL code. I have Googled a solution to this task and have tried creating these tables using the DDL code in a query within a blank MS Access database. Is there a more expedient way to achieve this? I noticed, for example, that a field in DB2 has a data type of "decimal" while the same field would have the data type of "number". Thanks, Zuf What follows is the DDL: -------...

How to set Data source in MS Word as MS Access Databases via DDE(*.mdb;*.mde).
How to set Data source in MS Word as MS Access Databases via DDE(*.mdb;*.mde). Everytime i click the command button to merge the data, it gives me item not found and i know that its a problem with my datasource. when i click ok then it opens the word doucment prompting me which datasource you want to use, when i click DDE then it gives me the merged data. Is there anyway i can set it permanantely in my codes below. Private Sub SetQuery(strQueryName As String, strSQL As String) On Error GoTo ErrorHandler 'set the query from which the merge ' document will pull its i...

Accessing Oracle Tables from MS Access
How difficult is this? I'm having a tough time getting a simple select to work. I am using MS Access 2002 and Windows XP. What do I have to do to make a simple select statement like this work: select id from emp I have stumbled upon many websites although none straight to the point. Any help in how to get this done, or pointing me in the right direction of a book or website, would be greatly appreciated! berj Yes, I do have the table links working. But I did want to run the select for such things as grabbing the next number off of a sequence. As in: select test.nextval fro...

Reading an MS Access Database file on *NIX platform using PHP
I'm building a small web application for a friend using PHP. He'd like to use MS Access to keep the data in, and update the data on the site by FTP'ing Access files he edits on his machine up to the web host. The web host is unix-based (FreeBSD, slightly hacked by Verio, I believe), so this means COM functions aren't available. ODBC was my next thought, but I've never used it, and there are a few things I don't understand. Setting up a DSN is one of them -- apparently this isn't as simple as constructing a string, and all the tutorials I can find seem to involve ...

how to access data iin a MS Excel file using database components?
Can we read data in columns from an MS Excel file? It is possible to use the usual database components in the Delphi palete to read data in an excel file? but how? ...

HELP! Retriving field names and properties from MS Access database using ASP
Hi everyone! I have a really frustrating error and need help. I&#8217;m trying to do a function that gets the properties and names of the fields in a MS Access database using ASP. I haven&#8217;t programmed in a while so I&#8217;m quite lost. Once I have the my database structure I will insert the corresponding fields from a web form but the database is huge and I want to be able to change the database and form without changing the ASP code all the time. This is my function that is not working yet. I cant seem to connect properly to the database... Function InsertDataBase() ...

Download MDB file from binary Web Service using MS Access and VBA
I am trying to automate a process which would call a ASPX web page and download a resultant MDB file to a local folder on my server. I am trying to do this process with a command button on a MS Access form. I am using MS Access 2003. I have found similar code, but, they use the old INET data type which is not available in any of the current refernces that come with Office 2003. Does anyone know how to do something like this using MS Access 2003 and VBA? Can you provide the reference and sample code you've used? Thanks SteveB <stephen.bray@usbank.com> wrote: >I am trying to automate a process which would call a ASPX web page and >download a resultant MDB file to a local folder on my server. I am >trying to do this process with a command button on a MS Access form. >I am using MS Access 2003. I have found similar code, but, they use >the old INET data type which is not available in any of the current >refernces that come with Office 2003. Does anyone know how to do >something like this using MS Access 2003 and VBA? Can you provide the >reference and sample code you've used? Haven't used it but what about this one. Not Internet Data transfer Library http://www.mvps.org/access/modules/mdl0037.htm Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ Granite Fleet Manager http://www.granitefleet.c...

I get ODBC Timeout (#0) just trying to open a linked table in MS Access 2003 arghghghgh!!!
any idea how i can by pass this error , i need to plugin a SQL vew & create a query using Access. Running the vew in SQL returns 19458 rows ... i keep getting ODBC timeout errors when trying to do anything with this linked table.. help?! ...

Accessing MS-Access from OpenRoad using ActiveX
Hi I'm wanting to conect to an MS-Access MDB file from an OpenRoad program using ActiveX. Can someone tell me the files I need to use/register for Windows XP? Any other help or suggestions would be most appreciated. Darren dharvey911@hotmail.com ...

Web resources about - How to get table names from ms access(mdb file) by using odbc library. - comp.databases.ms-access

Library - Wikipedia, the free encyclopedia
A library is an organized collection of sources of information and similar resources, made accessible to a defined community for reference or ...

Library - Wikipedia, the free encyclopedia
A library is an organized collection of sources of information and similar resources, made accessible to a defined community for reference or ...

Library - Wikipedia, the free encyclopedia
A library's collection can include books , periodicals , newspapers , manuscripts , films , maps , prints , documents , microform , CDs , cassettes ...

Man charged after stalking girl in Cabramatta library for months: police
A man has been charged after allegedly stalking a teenage girl for several months at a library in Sydney's south-west.

Indigenous women celebrated in State Library exhibition
Exhibition celebrates identity of Aboriginal and Torres Strait Islander women. An exhibition that represents and celebrates the identity of Aboriginal ...

Mill Woods library closed temporarily after 50-lb. lights crash to floor
As library support staff arrived at work at the Mill Woods branch Wednesday morning, they discovered three 50-pound lighting fixtures had crashed ...

This 'Human Library' Put A Face To The Israeli-Palestinian Conflict
The Palestinians and Jews of the community posed as a "human library" on Palestine. Each had a desk and a sign specifying if they were Palestinian ...

Pembroke Public Library
My account Change My Password Logout Search Autos Homes Careers Classified Obituaries Postmedia Tuesday, March 15, 2016 Pembroke, ON 2° Fog Sponsored ...

tvOS 9.2 beta 6 w/ Dictation in text fields, iCloud Photo Library & much more hits Apple TV
Just over a week since the last tvOS 9.2 beta , Apple has released tvOS 9.2 beta 6 for developers with the fourth-gen Apple TV. Apple TV gains ...

Flowers left at Reagan Library following first lady's death
SIMI VALLEY, Calif. (AP) — The Ronald Reagan Presidential Library and Museum was closed Sunday following the death of Nancy Reagan, but a steady ...

Resources last updated: 3/20/2016 4:13:56 PM