I can create the table fine, but the records are not being added to my table. Can someone tell me why? Here's the code:
VB Code:
  1. 'Create a new table in the Database for the category
  2. Call ADOCreateTable
  3.  
  4. 'connect to the database
  5. Dim Cnn As ADODB.Connection
  6. Dim SQL As String
  7. Set Cnn = New ADODB.Connection
  8. Cnn.Open ConnectionString:="Provider=Microsoft.Jet.OLEDB.4.0;" & _
  9.       "Data Source= c:\windows\system\kamo.mdb;"
  10.  
  11. 'set table = to the category added
  12. table = txtcategory.Text
  13.  
  14. 'Loop through the filelistbox getting info on the files
  15. MusicMaster.File1.Path = txtpath.Text
  16. On Error Resume Next
  17. For x = 0 To MusicMaster.File1.ListCount - 1
  18.     fname = MusicMaster.File1.Path & "\" & MusicMaster.File1.List(x)
  19.     Call ReadMP3(fname, True, True)
  20.    
  21. 'Store the info as strings
  22.     strFilepath = fname
  23.     strFileName = MusicMaster.File1.List(x)
  24.     strFileSize = FileLen(fname)
  25.     strArtist = GetMP3Info.Artist
  26.     strTitle = GetMP3Info.Songname
  27.     strAlbum = GetMP3Info.Album
  28.     strTrack = GetMP3Info.Track
  29.     strFrequency = GetMP3Info.Frequency
  30.     strBitrate = GetMP3Info.Bitrate
  31.     strLength = GetMP3Info.Duration
  32.    
  33.    
  34. 'Use SQL to insert the information in the strings into the table
  35. SQL = "INSERT into " & table & " (Filepath,Filename,Filesize,Artist, _
  36. Title,Album,Frequency,Bitrate,Length, _
  37. Track#)VALUES ('" & strFilepath & "','" & _
  38.  strFileName & "','" & strFileSize & "','" & _
  39. strArtist & "','" & strTitle & _
  40. "','" & strAlbum & "','" & strTrack & _
  41.  "','" & strFrequency & "','" & strBitrate & _
  42.  "','" & strLength & "')"
  43. Cnn.Execute (SQL)
  44.  
  45. Next 'Loop through getting info and adding a record for each item in the filelistbox.