Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all, we have some important news to share. Please follow the link here to find out more!

https://www.boards.ie/discussion/2058419143/important-news/p1?new=1

Visual Basic COM objects for MTS

  • 12-07-2000 05:31PM
    #1
    Registered Users, Registered Users 2 Posts: 2,831 ✭✭✭


    Lo all, lil problem here...help appreciated!

    I'm writing an MTS com object in VB for ASP use. I want to access a
    database within a function in the com and return the recordset to the ASP
    for formatting and display to user.

    I can return the recordset in a Variant Array, but this is really slow. Any
    ideas how I can get around this? Can it be done? I want to be able to use
    the usual ADO recordset commands like .movenext in my ASP.

    Thanks in advance for anyone who wants to have a go! Code follows...(watch
    for wrap)

    Tony Worrall

    Function GetSatelliteNews() As Recordset

    Dim sSQL As String
    Dim iId As Integer

    'Change the number of this int to display the corresponding news items
    iId = 1

    sSQL = "SELECT NewsId, AuthorID, Date, Title, Source, Text From News Where
    SubjectID =" & iId & " Order By Date desc"
    Dim rs As New ADODB.Recordset
    rs.CursorType = adOpenStatic
    Const sConnect = "DSN=News;UID=*****;PWD=*****;"
    rs.Open sSQL, sConnect
    GetSatelliteNews = rs.GetRows
    rs.Close
    End Function


Comments

Advertisement