MediaMonkey, SQLite, HeidiSQL
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
Player de música... MediaMonkey
Que tal acessar a base dele?
Interessante a brincadeira.
Agora é descobrir como usar isso no Harbour, ou no ADO, quem sabe.
Nota: O artista do álbum é pra diferenciar das músicas do meu filho kkkk
Que tal acessar a base dele?
Interessante a brincadeira.
Agora é descobrir como usar isso no Harbour, ou no ADO, quem sabe.
Nota: O artista do álbum é pra diferenciar das músicas do meu filho kkkk
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
O Harbour já tem SQLLite embutido, funciona sem nada adicional.
Só se quiser usar ADO, aí é do de sempre, instalar o ODBC
http://www.ch-werner.de/sqliteodbc/
Só se quiser usar ADO, aí é do de sempre, instalar o ODBC
http://www.ch-werner.de/sqliteodbc/
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
Fica fácil imaginar como o MediaMonkey escolhe músicas.
E daria pra usar no aplicativo igual.
E daria pra usar no aplicativo igual.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
No lugar deste.
Ao invés de encher de filtros, permitir que o usuário adicione filtros se precisar.
Ficaria menos poluído de opções, ao mesmo tempo que poderia dar mais opções.
É pra se pensar....
Ao invés de encher de filtros, permitir que o usuário adicione filtros se precisar.
Ficaria menos poluído de opções, ao mesmo tempo que poderia dar mais opções.
É pra se pensar....
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
Uia.....
ADO é ADO....
Dizemos pra ele qual é o ODBC e pronto.
Acessando a biblioteca do MediaMonkey, em formato SQLite3.
ADO é ADO....
Dizemos pra ele qual é o ODBC e pronto.
Código: Selecionar todos
PROCEDURE PTESSQLITE
LOCAL oTBrowse
LOCAL cnSQL := ADOClass():New( SQLiteConnection( "D:\TOOLS\MediaMonkey\MM.DB" ) )
WITH OBJECT cnSQL
:cSQL := "SELECT ID, SongTitle, FileLength, SongLength, Rating, Bitrate, Encoder FROM Songs"
:Execute()
oTBrowse := { ;
{ "ID", { || Str( :Number( "ID" ), 10 ) } }, ;
{ "SongTitle", { || :String( "SongTitle", 50 ) } }, ;
{ "FileLength", { || Str( :Number( "FileLength" ), 16 ) } }, ;
{ "SongLenth", { || Str( :Number( "SongLength" ), 16 ) } }, ;
{ "Bitrate", { || Str( :Number( "Bitrate" ), 16 ) } }, ;
{ "Encoder", { || :String( "Encoder", 20 ) } } }
BrowseADO( cnSQL, oTBrowse, "SONGTITLE" )
:CloseRecordset()
ENDWITH
RETURN
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
Código: Selecionar todos
PROCEDURE PTESSQLITE
LOCAL oTBrowse
LOCAL cnSQL := ADOClass():New( SQLiteConnection( "D:\TOOLS\MediaMonkey\MM.DB" ) )
WITH OBJECT cnSQL
:cSQL := "SELECT Songs.ID, SongTitle, FileLength, SongLength, Rating, Bitrate, Encoder," + ;
" IDAlbum, Artists.Artist, Albums.Album" + ;
" FROM Songs" + ;
" INNER JOIN Albums ON Albums.ID = Songs.IDAlbum" + ;
" INNER JOIN ArtistsSongs ON ArtistsSongs.IDSong = Songs.ID" + ;
" INNER JOIN Artists ON Artists.ID = ArtistsSongs.IDArtist" + ;
" WHERE Artists.Artist = 'iron maiden'" + ;
" ORDER BY Artists.Artist, SongTitle"
:Execute()
oTBrowse := { ;
{ "ID", { || Str( :Number( "ID" ), 10 ) } }, ;
{ "Artist", { || :String( "Artist", 50 ) } }, ;
{ "SongTitle", { || :String( "SongTitle", 50 ) } }, ;
{ "FileLength", { || Str( :Number( "FileLength" ), 16 ) } }, ;
{ "SongLenth", { || Str( :Number( "SongLength" ), 16 ) } }, ;
{ "Bitrate", { || Str( :Number( "Bitrate" ), 16 ) } }, ;
{ "Encoder", { || :String( "Encoder", 20 ) } } }
BrowseADO( cnSQL, oTBrowse, "SONGTITLE" )
:CloseRecordset()
ENDWITH
RETURN
Do fórum do MediaMonkey:-2147467259 no such collation sequence: IUNICODE (1)
Full SQL:
SELECT Songs.ID, SongTitle, FileLength, SongLength, Rating, Bitrate, Encoder, IDAlbum, Artists.Artist, Albums.Album FROM Songs INNER JOIN Albums ON Albums.ID = Songs.IDAlbum INNER JOIN ArtistsSongs ON ArtistsSongs.IDSong = Songs.ID INNER JOIN Artists ON Artists.ID = ArtistsSongs.IDArtist WHERE Artists.Artist = 'iron maiden' ORDER BY Artists.Artist, SongTitle;
Por causa de limitações do SQLite, o MediaMonkey usa página de caracteres CUSTOMIZADA.We use custom Collation in our DB due the limits of SQLite and if you are able to import data from linked Tables than you should be safe. but searches and edits back can need Collation and will throw an errors.
https://www.mediamonkey.com/forum/viewtopic.php?t=93400
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
Só comentário sobre o comando:
Songs contém as músicas e IDAlbum
Albums contém o nome dos álbums
ArtistsSongs contém IDSongs e IDArtista
Artists contém o nome dos artistas
Então, pra pegar a música, o nome do disco, e o nome do artista, precisa dos 4
Songs contém as músicas e IDAlbum
Albums contém o nome dos álbums
ArtistsSongs contém IDSongs e IDArtista
Artists contém o nome dos artistas
Então, pra pegar a música, o nome do disco, e o nome do artista, precisa dos 4
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
Sem o ORDER BY funciona.
Suposição:
codepage customizada, precisa conhecer a codepage pra poder colocar em ordem.
Não gostei da palavra "limitação", e muito menos do banco SQLite acabar não sendo padrão.
Mas de qualquer forma é interessante....
Código: Selecionar todos
PROCEDURE PTESSQLITE
LOCAL oTBrowse
LOCAL cnSQL := ADOClass():New( SQLiteConnection( "D:\TOOLS\MediaMonkey\MM.DB" ) )
WITH OBJECT cnSQL
:cSQL := "SELECT Songs.ID, SongTitle, FileLength, SongLength, Rating, Bitrate, Encoder," + ;
" IDAlbum, Artists.Artist, Albums.Album" + ;
" FROM Songs" + ;
" INNER JOIN Albums ON Albums.ID = Songs.IDAlbum" + ;
" INNER JOIN ArtistsSongs ON ArtistsSongs.IDSong = Songs.ID" + ;
" INNER JOIN Artists ON Artists.ID = ArtistsSongs.IDArtist" + ;
" WHERE Artists.Artist LIKE '%iron maiden%'"
:Execute()
oTBrowse := { ;
{ "ID", { || Str( :Number( "ID" ), 10 ) } }, ;
{ "Artist", { || :String( "Artist", 20 ) } }, ;
{ "Album", { || :String( "Album", 20 ) } }, ;
{ "SongTitle", { || :String( "SongTitle", 50 ) } }, ;
{ "FileLength", { || Str( :Number( "FileLength" ), 16 ) } }, ;
{ "SongLenth", { || Str( :Number( "SongLength" ), 16 ) } }, ;
{ "Bitrate", { || Str( :Number( "Bitrate" ), 16 ) } }, ;
{ "Encoder", { || :String( "Encoder", 20 ) } } }
BrowseADO( cnSQL, oTBrowse, "SONGTITLE" )
:CloseRecordset()
ENDWITH
RETURN
codepage customizada, precisa conhecer a codepage pra poder colocar em ordem.
Não gostei da palavra "limitação", e muito menos do banco SQLite acabar não sendo padrão.
Mas de qualquer forma é interessante....
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
Lembrei da diferença entre MySQL e SQL Server....
No SQLite é igual MySQL: aceitou LIMIT 10
Não testei outros comandos, mas.... o aplicativo poderia funcionar em SQLite ou MySQL apenas trocando a string de conexão, pelo menos para esses comandos básicos.
No SQLite é igual MySQL: aceitou LIMIT 10
Código: Selecionar todos
:cSQL := "SELECT Songs.ID, SongTitle, FileLength, SongLength, Rating, Bitrate, Encoder," + ;
" IDAlbum, Artists.Artist, Albums.Album" + ;
" FROM Songs" + ;
" INNER JOIN Albums ON Albums.ID = Songs.IDAlbum" + ;
" INNER JOIN ArtistsSongs ON ArtistsSongs.IDSong = Songs.ID" + ;
" INNER JOIN Artists ON Artists.ID = ArtistsSongs.IDArtist" + ;
" WHERE Artists.Artist LIKE '%iron maiden%'" + ;
" LIMIT 10"
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
MediaMonkey, SQLite, HeidiSQL
A única coisa que mudou para o MySQL foi a string de conexão.
Atenção ao SQLITE3 no nome, porque se usar SQLITE diz que a base está corrompida !!!!
Talvez no SQLite anterior não houvesse opção de codepage/collation.
Código: Selecionar todos
FUNCTION SQLiteConnection( cFileName )
LOCAL oConexao := win_OleCreateObject( "ADODB.Connection" )
oConexao:ConnectionString := iif( win_OsIs10(), "Provider=MSDASQL;", "" ) + ;
"Driver={SQLite3 ODBC Driver};Database=" + cFileName + ";"
oConexao:CursorLocation := AD_USE_CLIENT
oConexao:CommandTimeOut := 20
RETURN oConexao
Talvez no SQLite anterior não houvesse opção de codepage/collation.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/