Hi Guys. im new on the site. Looks like im going to love it here. CAnt wait to begin.
What brought me here is a little runtime problem ive been having. I have suspected my terminal as "Zombie" but i cant proove it. anyhow if noone is wrewritting my runtime, maybe it is actually my coding. so, here i am.
I am doing a simple windows media player EVENT.
I just want to get media attributes for specific playback media at runtime.
I havent created the table to store these attributes
but i was hoping to create it in the same code.
heres my Error :
Runtime Error 91' Object Variable or With Block Variable not Set
Here's my Code:
Private Sub WindowsMediaPlayer6_ScriptCommand(ByVal scType As String, ByVal Param As String)
'Declare Active X
Dim Player As WMPLib.WindowsMediaPlayer
'Declare variables for Attribute name, Attribute value and counter integer
Dim AtName As Object
Dim AtValue As Variant
Dim i As Integer
'declare database and recordset for DAO
Dim Dbs As Database
Dim Rst As Recordset
'Set variables
i = 0
AtName = Player.currentMedia.getAttributeName(i)
AtValue = Player.currentMedia.getItemInfo(AtName)
'count number of attributes available for current media file then list each
' i also try to add each one as a new column in an already created table
Do Until i = Player.currentMedia.attributeCount
Dbs.Execute ("ALTER TABLE Log ADD COLUMN ""&AtName&")
AtValue = Player.currentMedia.getItemInfo(AtName)
i = i + 1
'i use the immediate window to check variable value and debug
Debug.Print AtName
Debug.Print AtValue
Loop
End Sub
I hope you can help guys.
I need it ASAP.
What brought me here is a little runtime problem ive been having. I have suspected my terminal as "Zombie" but i cant proove it. anyhow if noone is wrewritting my runtime, maybe it is actually my coding. so, here i am.
I am doing a simple windows media player EVENT.
I just want to get media attributes for specific playback media at runtime.
I havent created the table to store these attributes
but i was hoping to create it in the same code.
heres my Error :
Runtime Error 91' Object Variable or With Block Variable not Set
Here's my Code:
Private Sub WindowsMediaPlayer6_ScriptCommand(ByVal scType As String, ByVal Param As String)
'Declare Active X
Dim Player As WMPLib.WindowsMediaPlayer
'Declare variables for Attribute name, Attribute value and counter integer
Dim AtName As Object
Dim AtValue As Variant
Dim i As Integer
'declare database and recordset for DAO
Dim Dbs As Database
Dim Rst As Recordset
'Set variables
i = 0
AtName = Player.currentMedia.getAttributeName(i)
AtValue = Player.currentMedia.getItemInfo(AtName)
'count number of attributes available for current media file then list each
' i also try to add each one as a new column in an already created table
Do Until i = Player.currentMedia.attributeCount
Dbs.Execute ("ALTER TABLE Log ADD COLUMN ""&AtName&")
AtValue = Player.currentMedia.getItemInfo(AtName)
i = i + 1
'i use the immediate window to check variable value and debug
Debug.Print AtName
Debug.Print AtValue
Loop
End Sub
I hope you can help guys.
I need it ASAP.