Results 1 to 4 of 4

Thread: MDB

  1. #1

    Thread Starter
    Addicted Member Tiovital's Avatar
    Join Date
    Apr 2000
    Posts
    249
    Hi,
    I try this Q in Database Devalopment But there was no answers! so i think i will give it shot here.

    What is the Fast way to build a MDB Database and Table + insert a large amount of text-record to one of the table.
    Regards

  2. #2
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    When you say build database, I assume you mean from scratch? Well if done through coding then it's a big job.
    Why not create an empty database, with the tables, indexes etc already set up, then use the CompactDatabase method to create a duplicate:

    Add a reference to the 'Microsoft DAO 3.6 Object Library', then use:
    Code:
    DBEngine.CompactDatabase(strTemplateDb, strDestinationDb.Text, dbLangGeneral, dbVersion40)
    Now create a connection to the new database and do an INSERT SQL statement with your data

    If the data is in another database then use the following:
    Code:
        strSQL = "SELECT [" & strTable & "].* " & _
                 "INTO [" & strTable & "] " & _
                 "IN '" & strDestinationDb & "' " & _
                 "FROM [" & strTable & "]"
                 
        dbSource.Execute strSQL
    Loads more ways, but you will have to be more specific!


    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  3. #3

    Thread Starter
    Addicted Member Tiovital's Avatar
    Join Date
    Apr 2000
    Posts
    249
    Hi,
    Well i have a huge TEXT file that i want to migrate to a DataBase. I want the ability to search the Db for a Key, the first 15 bytes of evry record is a unique number in the TEXT file.


    Thanks for the quick reply and regards

  4. #4
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    If the text file is delimited into fields already, create a new database in access and select 'Import Table' from the 'New Table' command. Select 'Text Files' from the file type list and follow the wizard to create the table.

    When complete, you will have to check the data and do any clean up work with the field names attributes etc.

    Good luck

    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width