Batch import to database

Plugin help and Support

Moderators: webmaster, Christian, Kuok-Tim, ChrisClark, NACarter, Forum Support

Batch import to database

Postby grobinson » Mon Nov 08, 2004 10:51 am

I am considering switching to from Powerpoint to Zionworx. I already have about 600 songs in both Word and powerpoint format...I have written macrois to convert between the two.

Is there a simple way to import songs to the database in batch mode? For me to write a macro to reformat the data in text format is a trivial exercise. But I would like to extract the relevant data and import to the database avoiding t6he need to paste 600 songs into the interactive import tool.

Given that the data go into 2 separate database files, how do I format the text files and massage the data.
Grant Robinson
Springwood Winmalee Anglican Church
grobinson
Junior
 
Posts: 4
Joined: Mon Mar 08, 2004 10:55 am

Postby Williamting » Mon Nov 08, 2004 2:37 pm

Grant,
What I have done is to format all the text and arrange them on a spreadsheet (title, alternate title, Lyrics, etc). You then use MSAccess to open the DBF file (discussed somewhere in this forum) and open the Songs table. The next thing is to cut-and-paste across from Excel to Access.

You must ensure that the columns matches and if you can open up the Songs table, you will know the column arangement.

With blessings!
William
Williamting
Most Senior
 
Posts: 146
Joined: Sat Sep 13, 2003 5:11 am
Location: Miri, Malaysia

Postby grobinson » Mon Nov 08, 2004 8:30 pm

How then does the DBT file get updated?
grobinson
Junior
 
Posts: 4
Joined: Mon Mar 08, 2004 10:55 am

Postby Williamting » Mon Nov 08, 2004 11:49 pm

Grant,
My understanding is that DBT is an index file which is normally controlled by application.
William
Williamting
Most Senior
 
Posts: 146
Joined: Sat Sep 13, 2003 5:11 am
Location: Miri, Malaysia

Database import

Postby kck » Tue Nov 09, 2004 10:52 am

You can use Access to import from a text file, rearrange the columns as necessary and then export in dBase format. This creates both the DBF and DBT files.
You can then import these in one go using the "Import" option of the "Database" menu. (Not the same as the import option in the add/edit window).

There's probably a better way to do this but that was how I managed myself.
I vaguely recall that the version of dBase mattered. I think dBase V failed for some reason. I used III or IV. (Can't remember which).

Steve
kck
Senior
 
Posts: 57
Joined: Mon Jul 12, 2004 3:39 pm
Location: Cumbria, UK

Database import

Postby kck » Tue Nov 09, 2004 11:06 am

I have found these random notes which I made while trying to import songs.
Don't take them as gospel. They were made as I went through the process and haven't been checked properly since.

Suggestion: (Although long-winded, this seems to work). Other ways I have tried have resulted in missing titles, complaints about incorrect formats or missing words (or even verses in some cases)

Copy SONGS.DBF and SONGS.DBT so you have a backup.

In Zionworx, delete all the songs except one song of your choosing. Rename it to something obvious, e.g. ___DUMMY_SONG____

Exit Zionworx and copy or rename the new SONGS.DBF and SONGS.DBT files to something like ONE_SONG.DBF, etc.

Copy these files into 2 new files called IMPORT.DBF & IMPORT.DBT.

Open Import.mdb (in MS Access).

Link (don't import) the ONE_SONG.DBF file into a table.

Either link or import your new song data into tables depending on the format you have it in.

Add the new songs to the linked IMPORT table using an append query.
(SQL - "insert into IMPORT select * from mynewsongstable")

Close the database

Rename the IMPORT.DBF & IMPORT.DBT files with a meaningful name for where the songs came from.

These files can now be imported into Zionworx using the database import facility.

It is quite likely that you will find duplicate titles when you run the import. In this case you can look for them in the database and rename them. You can then restore your original SONGS.DBF & SONGS.DBT files and re-run the import.


Deleting records from a linked table in Access doesn't seem to have deleted them when it comes to importing them into Zionworx. Not sure why not. Compacting and repairing the database doesn't make any difference.


If songs are getting corrupted, try looking for odd characters, e.g. TABs which don't display properly anyway.

If songs appear to be split in odd places despite what the editing version suggests, try looking for spaces on the ends of lines.


I also remember that when pulling the data into Access I had to put the lyrics in a separate file otherwise it all went awry because the lyrics had linefeeds/carriage returns in which was what I was using as a record separator.

Hope that's helpful,
Steve
kck
Senior
 
Posts: 57
Joined: Mon Jul 12, 2004 3:39 pm
Location: Cumbria, UK

Postby Peter_in_Christ » Fri Jan 14, 2005 4:39 pm

Just a note:

ZionWorx uses Dbase IV database format.

*.dbf contains everything stored in fields (from Titles, Authoer and etc) except the contents of your Lyrics, the Lyrics field are store in *.dbf referenced by *.dbf referring to MEMO data stored in *.dbt.


The field length of this MEMO in *.dbt should be around 8000 Characters of the ASCII character set, otherwise ZionWorx 2.0 can't cope and will crash on you :D

You can't load a *.dbf database on it's own if it requires a *.dbt file.
Hope this helps.

Peter

P.S. In time I may develop a program to import data from an *.xls, *.mdb and etc directly into *.dbf and it's corresponding *.dbt file. However, this will require users of ZionWorx having to install ADO/OLE DB libraries provided by Microsft, usually user who don't already have Microsoft Office installed on their system have to install these.

Quoting from: http://delphi.about.com/od/database/l/aa022001c.htm

ADO is a set of COM components (DLLs) that allow you to access databases as well as e-mail and file systems. Applications built with ADO components don't require the BDE.
To access any kind of database with ADO, you'll of course need to have ADO/OLE DB libraries. Everything you need to use ADO is probably already on your computer: the files are distributed by Microsoft as a part of Windows 98/2000. If you or your client use Windows 95 or Windows NT you will probably need to distribute and install the ADO engine. Delphi 5's CD includes an installation of MDAC - Microsoft Data Access Components. You should always make sure to have the latest version, which is available from Microsoft. The Microsoft Data Access Components are the key technologies that enable Universal Data Access. They include ActiveX Data Objects (ADO), OLE DB, and Open Database Connectivity (ODBC).
Note: to install correctly on a Windows 95 computer, MDAC requires that DCOM95 be installed. MDAC installs components that rely on DLLs installed by DCOM95 in order to register correctly. Note that DCOM95 is not required on a Windows NT 4.0. In some cases, DCOM may not be installed on a Windows 98 computer. If it has not been installed, then DCOM98 should be installed prior to the installation of MDAC.
\o/ The Lord is Gracious and Compassionate, Slow to anger and Rich in Love. \o/
Peter_in_Christ
Senior
 
Posts: 56
Joined: Tue Jan 13, 2004 12:04 am
Location: UK, London


Return to Songs of Fellowship

Who is online

Users browsing this forum: No registered users and 1 guest

cron