[slinkelist] Working with databases
Tang, George
gtang@gtcons.com
Mon, 17 Apr 2000 09:06:43 -0700
The new version of CDJ will convert your existing mdb database to the new
format. The only changes to the database format is a couple of added
columns, nothing more. You might still want to double check your code to
make sure you still get the right result.
In regards to your second issue of getting your mdb at work with the added
queries, modules, and tables into the mdb file that you have at home with
the new data, Access has this wonderful feature of importing and exporting
any part of the Access database. After you get the new version of CDJ
installed (make sure you make backups of your existing mdb file) and it has
converted your existing database to the new format, open the new mdb file
and import the queries, VBA modules, and any other tables you have created
in the mdb file from work.
George
-----Original Message-----
From: slinkelist-admin@nirvis.com [mailto:slinkelist-admin@nirvis.com]On
Behalf Of John W. Schaaf
Sent: Monday, April 17, 2000 7:08 AM
To: slinkelist@nirvis.com
Subject: [slinkelist] Working with databases
Hi all,
I have been playing with a faster way to create playlists using MS Access
and
user.mdb from CDJ and I have a few questions. First, I am new to using MS
Access and VBA (but not new to computers or programming) so please forgive
me if
I ask easy to answer questions.
1) I just read in a post that there is a new DB format. I have not
upgraded to
the latest version, I think I am using 2.7 ( It is at home and I am at work
so I
can't look at the moment ). My question is, doing all this work in MS
Access,
will I be able to bring in the new database format and record data? I am
only
using a couple of the fields to do the work, CDJID, Artist, Album name,
Track
name, and track #.
2) In a related question, I have brought the DB to work to do this. Now I
have
added new CD's at home, how do I add or import them or replace the DB with
the
most recent data?
3) I am exporting from MS Access to a plain text file for the playlist. I
need
to add "CDJ Playlist" to the top of the file and I have to decrement all the
track numbers by 1 (Colby, why is this the case when everywhere else we
look, we
see the actual track numbers). Below is the VBA code I wrote to accomplish
this. My output file is garbage. Any idea why?
*** Begin code ***
Option Compare Database
Option Explicit
Private Type Record ' Define user-defined type.
Album As String * 9
Track As Integer
End Type
Private Sub Command10_Click()
Dim FileName, Header As String
Dim MyRecord As Record ' Declare variables.
Header = "CDJ Playlist"
Open "c:\download\playlist.pla" For Random As #1
Open "c:\download\fileout.pla" For Random As #2
Put #2, , Header
Do While Not EOF(1)
' Read the file using the Get statement.
Get #1, , MyRecord ' Read the record.
MyRecord.Track = MyRecord.Track - 1
Put #2, , MyRecord
Loop
Close #1
Close #2
Exit Sub
End Sub
*** End code ***
4) How can I prompt the user for the full path and filename of where to
save
the finished playlist? I tried InputBox, but it gave me an error and I
would
really prefer to use the standard Windows "SaveAs" dialog boxes.
5) How do I give my finished project to other people? It is run within MS
Access and contains a query and reports and the VBA code. I would love to
upload it to the Nirvis site once it is finished.
Thanks so much for your time and help.
John Schaaf
_______________________________________________
slinkelist maillist - slinkelist@nirvis.com
http://www.nirvis.com/mailman/listinfo/slinkelist