'Create a new table in the Database for the category
Call ADOCreateTable
'connect to the database
Dim Cnn As ADODB.Connection
Dim SQL As String
Set Cnn = New ADODB.Connection
Cnn.Open ConnectionString:="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= c:\windows\system\kamo.mdb;"
'set table = to the category added
table = txtcategory.Text
'Loop through the filelistbox getting info on the files
MusicMaster.File1.Path = txtpath.Text
On Error Resume Next
For x = 0 To MusicMaster.File1.ListCount - 1
fname = MusicMaster.File1.Path & "\" & MusicMaster.File1.List(x)
Call ReadMP3(fname, True, True)
'Store the info as strings
strFilepath = fname
strFileName = MusicMaster.File1.List(x)
strFileSize = FileLen(fname)
strArtist = GetMP3Info.Artist
strTitle = GetMP3Info.Songname
strAlbum = GetMP3Info.Album
strTrack = GetMP3Info.Track
strFrequency = GetMP3Info.Frequency
strBitrate = GetMP3Info.Bitrate
strLength = GetMP3Info.Duration
'Use SQL to insert the information in the strings into the table
SQL = "INSERT into " & table & " (Filepath,Filename,Filesize,Artist, _
Title,Album,Frequency,Bitrate,Length, _
Track#)VALUES ('" & strFilepath & "','" & _
strFileName & "','" & strFileSize & "','" & _
strArtist & "','" & strTitle & _
"','" & strAlbum & "','" & strTrack & _
"','" & strFrequency & "','" & strBitrate & _
"','" & strLength & "')"
Cnn.Execute (SQL)
Next 'Loop through getting info and adding a record for each item in the filelistbox.