« Home | Math Games - A Fun Way to Learning Math » | Cool Mist Humidifiers - New Technology Versus Prov... » | World of Warcraft Professions » | Fashion Design Games » | Role Playing Games--Character Guide 4 » | Where is the Grate Guy Casino in Mario RPG? » | Dymaxion Drilling Technology Promises Big Drop in ... » | Best and Worst Video Games » | Free Mmorpg Downloads, The Way To Go To Check Out ... » | Jobs In The Video Game Industry: What To Expect Fr... » 

Thursday, October 16, 2008 

Importing External Access Database Tables Using Visual Basic

Sometimes a Microsoft Access database user may find it desirable to automate AGame Boy Batteries & Chargers process PC Games Other Accessoriess importing tables from an external Access database file into their current database. Below is a segment of code that provides an example of how to accomplish this.

CODE

Dim root As String

Dim srcDB As database

Dim tdf As TableDef

Dim x As Integer

Root = "C:\"

Set srcDB = OpenDatabase(root)

For Each tdf In srcDB.TableDefs

x = 0

If (tdf.Name = "CULVERT") Then

DoCmd.TransferDatabase acImport, "Microsoft Access", root, acTable, "CULVERT", "CULVERT"

errorCheck = 1

End If

Next tdf

After Sega CD Accessories variable Nintendo Top Games the first line of code sets the variable "root" equal to "C:\" which is the location of the external database holding the tables we wish to import. The next line sets our database variable equal to the external database. The next lines of code search through the external database to find the table named "CULVERT." If this table is found, the table is imported using the DoCmd function. The "acImport" variable simply tells the function that we wish to import information from the database. "Microsoft Access" specifies the type of database containing the table. Following that is the folder location ("root") of the external database. The variable actable specifies that the object we wish to import is a table. The next two strings contain the table name to import and the name to assign to the imported table when it is imported into the current database.

Once the desired tables have been imported, they can be utilized just like any of the other tables in the database.

Nicholas Brown is a recognized authority on the subject of Access Databases. He is the founder of Database Technology Services (DTS). DTS is a leader in custom Access database development. DTS programmers create databases for corporations, small businesses and individuals. Visit http://www.dts-consultants.com to see all of the services DTS has to offer.

Dear Abby - DEAR ABBY: My wife and I have been married a year and a half. I was childless; she came into the marriage with three sons. The middle son went to live with his father, and I bonded with the oldest (age 17) and the youngest (age 9). Both boys called me Dad, and I called Latest Video Games my sons.

About me

  • I'm bridgettfcr
  • From
My profile

Archives

Powered by Blogger
and Blogger Templates