[slinkelist] Working with databases
John W. Schaaf
jschaaf@wyseadv.com
Mon, 17 Apr 2000 10:07:30 -0400
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