Link to home
Start Free TrialLog in
Avatar of rzvika2
rzvika2

asked on

Query in access 97

i have a MY_T table which has 3 fields: F_1,F_2,F_3
i want(with code) to get the values of F_2,F_3 (where F_1 equalls to a number X).
how can i do it?
ASKER CERTIFIED SOLUTION
Avatar of mkmccreary
mkmccreary

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rzvika2
rzvika2

ASKER

it says:"method or data member not found"
about the: ".OpenRecordset" in the line:
Set rsRecords = DBEngine.Workspaces(0).OpenRecordset(sSQL)

Sorry,
    A little syntax error there.  The line should read

    Set rsRecords = DBEngine.Workspaces(0).Databases(0).OpenRecordset(sSQL)

Try this and see if it work.

Martin
Avatar of rzvika2

ASKER

well, the final cade(that the access was agree to do)is as followed:

    sSQL = "SELECT T_DefaultSpecialAngles.CodeAngle,    T_DefaultSpecialAngles.DegreeAngle, T_DefaultSpecialAngles.Convert FROM T_DefaultSpecialAngles Where T_DefaultSpecialAngles.CodeAngle = " & CAngle & ";"
    Set rsRecords = DBEngine.Workspaces(0).Databases(0).OpenRecordset(sSQL)
    If Not rsRecords.BOF And Not rsRecords.EOF Then
         rsRecords.MoveFirst
         While Not rsRecords.EOF
            a = rsRecords!Convert
            b = rsRecords!DegreeAngle
            c = rsRecords!CodeAngle
            rsRecords.MoveNext
         Wend
    End If
    rsRecords.Close
    Set rsRecords = Nothing

(the only missed thing was the  "rsRecords.MoveNext")
thank you!
(by the way, if you tell me the actions that i have to do in order to play wave and avi files by access, i'll give you more 40 points).
and thank you again.

Here you go.  If in Access 97 open the form you wish to play the files from in design mode.  You then need to use the Insert menu and select ActiveX Controls.  Select the 'Microsoft MCI Control'.  You then need to add the below code from where you want the playing to occur:


    ' Initialize the control
    MMControl1.Visible = False
    MMControl1.Enabled = False
    MMControl1.Notify = False
    MMControl1.Wait = True
    MMControl1.Shareable = False
   
    ' Play a wave file
    MMControl1.DeviceType = "WaveAudio"
    MMControl1.Filename = "D:\WINNT\Media\chimes.WAV"
    MMControl1.Command = "Open"
    MMControl1.Wait = True
    MMControl1.Command = "Play"
    MMControl1.Command = "Close"
   
    ' Play an AVI file
    MMControl1.DeviceType = "AVIVideo"
    MMControl1.Filename = "D:\WINNT\clock.avi"
    MMControl1.Command = "Open"
    MMControl1.Wait = True
    MMControl1.Command = "Play"
    MMControl1.Command = "Close"
 
You may want to hide the control in the form load event, or you may want to allow the user to control the play, it is up to you.  I hope this helps you out.

Later,
Martin

Avatar of rzvika2

ASKER

thank you mkmccreary or Martin.
i dont have the option of upgrade the points, so tell me what or where to ask you this question again so that i could give you what i prommised.
btw, i didn't try it but if i have questions i will ask you again. thank you very much.
Avatar of rzvika2

ASKER

when i insert the  Microsoft Music Control it says:
"the operation on the ole object failed
the ole server may not be registered"
what sould i do?
thank you again!
I try to insert the Music control and get the same error, but there is a good side, we don't want to use this control.  We want to use the Microsoft Multimedia Control.  

Hope It Helps,
Martin

Avatar of rzvika2

ASKER

i dont have Microsoft Multimedia Control (what is its exact name?) and how can i install it , if necesary?
and by the way, if i want to play a wave or avi, and i don't want a control like in the compact disc(play , forward etc...)do i have to put that activeX anyway?
Try this code and see if it works.  It is Dim-ing a control of type MMControl which I use to play the files.  I placed this code under a command button to test it.  You will also have to change the filenames to valid files.  Try this:

Dim MMControl1 As New MMControl

    ' Initialize the control
    MMControl1.Notify = False
    MMControl1.Wait = True
    MMControl1.Shareable = False
     
    ' Play a wave file
    MMControl1.DeviceType = "WaveAudio"
    MMControl1.FileName = "c:\WINNT\Media\chimes.WAV"
    MMControl1.Command = "Open"
    MMControl1.Wait = True
    MMControl1.Command = "Play"
    MMControl1.Command = "Close"
     
    ' Play an AVI file
    MMControl1.DeviceType = "AVIVideo"
    MMControl1.FileName = "c:\WINNT\clock.avi"
    MMControl1.Command = "Open"
    MMControl1.Wait = True
    MMControl1.Command = "Play"
    MMControl1.Command = "Close"

Set MMControl1 = Nothing

Just Drop Me A note and let me know how it works.

Avatar of rzvika2

ASKER

it doesn't know the MMcontrol .
i installed the whole office.
when i try to search in help about the MMcontrol, it doesn't find anything.
I figured out that the multimedia control does not ship with Office97, it ships with certain versions of VB as well as the Office Developers Addition.  I have found an article on how to do it with API calls.  The article is on Microsofts homepage at http://www.microsoft.com/accessdev/articles/movies.htm.  It covers both .AVI and .WAV files.  I didn't have time to read the whole article.

Good Luck,
Martin

Avatar of rzvika2

ASKER

hate to waste your time, thank you for keeping answering me!
now:
if i have the developer edition, it will be ok?
second, if i have the vb5 installed on my computer, this should work? should i do something special?(in the installation stage)?
thank you anyway.

It should be ok if you have the Developer's Addition or VB5 on your computer.  I didn't have to register the controls in Access, they were just there when I went to access them.  You may have to go to the Tools - ActiveX Controls menu option and select the register button to find and register the control.  Bye the way the name of the control is MCI32.OCX.

Hope this helps,
Martin

P/S  I'm not sure which versions of VB include the MCI32.OCX control.
Avatar of rzvika2

ASKER

mkmccreary:
TTTTTTAAAAAAAAANNNNNNNNNNKKKKKKKKKK you!!!
i went to : "http://www.microsoft.com/accessdev/articles/movies.htm"
and the actually put a word file with an access aplication that demonstrate what i wanted!!!
now tell me how can i give you more 40 pointes!
thank you again!!!
zvi.
Avatar of rzvika2

ASKER

can you help me with playing wav files in java applications?
it is quite urgent and i haven't got answer about this(the answers was about applets).

Sorry,
    No Java experience at this time.  I guess you could post a question and just put in the title for me only.  I don't know.  I just started playing last week.  I'm glad I was able to help you out.

Later,
Martin

Avatar of rzvika2

ASKER

mkmccreary, how can i ask you (and only you) a question ?
in any case, i asked a question about the details in a report.
if you could answer it, i will be very glad!
by
zvi.