Ok, I use the following code to get info about mp3 files and then store as strings. Now I want to take the strings and use SQL to INSERT them into a table (add rows). The "Call ADOCreateTable" in the code creates a new table in the db. You should be able to see what I want to do by looking at the below code. I tried just typing INSERT and VALUE SQL commands, but it says it needs to be set = to something. Do I need to declare I'm using SQL first or something?VB Code:
Private Sub Command2_Click() Dim x As Integer Dim strFilepath As String, strFileName As String, _ strFileSize As String, strArtist As String, _ strTitle As String, strAlbum As String, strTrack As String, _ strFrequency As String, strBitrate As String, _ strLength As String lstCategories.AddItem txtcategory.Text Call ADOCreateTable 'create the new table in the db For x = 0 To File1.ListCount - 1 'loop through the filelistbox fname = File1.Path & "\" & File1.List(x) ReadMP3 fname, True, True strFilepath = fname 'store the info as strings strFileName = 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 '------------------------------------------------------------------------ 'Here is where I want to add all the strings into the table '------------------------------------------------------------------------ Next 'do this for every file in the filelistbox Call WriteTextFile 'Updates entries in category combobox End Sub




Reply With Quote