Having Runtime Trouble

Local time
Today, 17:42
Joined
Aug 17, 2009
Messages
10
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.
 
You never set the dbs variable.
 
What error, on what line? What is the full code now?
 
Regarding the above and your PM. Don't forget we are all in different time zones. The above post was made at 11:44 PM my time. I was going to bed at that point.

That said, your post seems to be suggesting that I set up a db along the lines of your setup. I have neither the time nor inclination to do so. You didn't mention where the error was. I've never tried to work with Media Player, but I would assume that the variable has to be set in some way.
 

Users who are viewing this thread

Back
Top Bottom