Click here to Skip to main content
15,879,348 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have a access tool in which i can upload a Access database.

I use the below method to import the file.

DoCmd.TransferDatabase acImport, "Microsoft Access", strFilePath, acTable, strFileName, "Table" ".

Here strFileName is the filename of the uploaded file.
But instedd of filename i need the TableName inside that filename.

So please can anyone tell me how to get the table name of an uploaded file?
Posted

1 solution

Hi ,

The solution is

VB
Dim db      As DAO.Database
Dim tdf     As DAO.TableDef
Set db = OpenDatabase(strDBPath)
strTableName=db.TableDefs(0).Name
DoCmd.TransferDatabase acImport, "Microsoft Access", strDBPath, acTable,strTableName, "TempTable"  

db.Close
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900