View Single Post
  #4 (permalink)  
Old June 1st, 2005, 02:10 PM
eusebio eusebio is offline
Registered User
Join Date: May 2005
Location: , , Romania.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to eusebio

Thanks Brian,

I realised myself it was a mistake to pass a recordset to a double. The case syntax works perfectly as it is ... I changed it like you said ... it works the same ...
Now I have something like that
Public Function get_last_id(what) As Double
Dim ds As Database
Dim dds As Recordset
Dim myY
Set ds = OpenDatabase("c:\itc\bd\gestiuneIOMC.mdb")

    Select Case what
        Case "ref"
            k = "select max(nrreferat) as [kk] from tabelreferate;"
            Set dds = ds.OpenRecordset(k)
            myY = dds!kk
            MsgBox myY
        Case "data"
            k = "select min(datareferat) & max(datareferat) as [kk] from tabelreferate;"
            Set dds = ds.OpenRecordset(k)
            myY = dds!kk
            MsgBox myY
    End Select
End Function

Now it works ... if you have any sugestions please feel welcomed ... criticise also ...
I have to do an app and I'll use pretty much SQL (doesn't scare me cause I'm familiar with oracle) and I have a problem resolving what access can't do ...
DO you have any sugestions how to easy work with queries in VB6 & Access database ?

Thanks again,

Reply With Quote