Hi gang,
I have spent the better part of the afternoon attempting to write my very first MM3 script. It's VERY simple but I am pretty new at this... trial by fire, right?
The script simply reads in the contents of a text file, searches for matching songs in the database, and then updates the played and songs table with the information in the file. The file is a log of my windows mobile player so I can keep all of my played history inside media monkey, even if I'm on the run.
Now that I'm close to the end, I have run into a small snag when I try and update the database.
http://img132.imageshack.us/my.php?image=mmvv1.png
As you can see, it's a very simple update query that keeps producing this error. The VBscript that runs the query is:
SDB.Database.ExecSQL("UPDATE Songs SET Songs.PlayCounter = "&MMupdate.valuebyindex(2)&", Songs.LastTimePlayed = "&_
CDbl(MMupdate.valuebyindex(1)) & " WHERE Songs.ID = " &MMmatch.valuebyindex(0))
Since it is saying there is an error near a period ("."), I can only guess that has something to do with the LastTimePlayed number I am trying to update (XXXXX.XXXXXXXX) but I can't seem to get it in the right format to commit.
Any ideas? Thanks!
SQLite update error - What am I missing?
Try this:
Code: Select all
SDB.Database.ExecSQL("UPDATE Songs SET PlayCounter = "&MMupdate.valuebyindex(2)&", LastTimePlayed = "&_
CDbl(MMupdate.valuebyindex(1)) & " WHERE ID = " &MMmatch.valuebyindex(0)) Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
-
johnny2678
- Posts: 15
- Joined: Sun Aug 21, 2005 1:27 am
Bex, BRILLIANT!Bex wrote:Try this:Code: Select all
SDB.Database.ExecSQL("UPDATE Songs SET PlayCounter = "&MMupdate.valuebyindex(2)&", LastTimePlayed = "&_ CDbl(MMupdate.valuebyindex(1)) & " WHERE ID = " &MMmatch.valuebyindex(0))
Can't believe it was that simple.
Thanks
