/ Forums / Advansys Formativ / Creating Solutions with Formativ / Can I do an SQL query in a Formativ applet?

  • Creator
  • #3852

    If it can be done, what would code look like to return data from an SQL query?

  • Author
  • #6403
    Support 2


    Sorry for the delay in our response. We are currently participating at BrainShare 2002 in Salt Lake City and we should be able to respond shortly.


    Advansys Support

    Support 1a

    The answer depends on the technique you use to access the database. Another user has posted the following information that may help answer your question.


    To access any database defined in Data Source Name (you need to install an optional MDAC package from Microsoft. I used MDAC 2.5):

    Sub Main(Client, GWEvent)
    dim conn
    dim arr

    set conn = createobject(“ADODB.Connection”)
    conn.open(“DSN=putDSNHere; User ID=putUseridHere; ” & _

    arr = getRecords(“SELECT * FROM putTableNameHere”)
    End Sub

    Private Function getRecords(query) ‘returns a dwo-dimensional array with results
    dim rs

    set rs = conn.execute(query)
    getRecords = rs.getRows
    End Function

    If this doesn’t help, you may wish to consult one of the many VB/VBS resources available. (Formativ doesn’t provide any DB/SQL services inherently – you need to use an external service, such as ADO, to provide DB support).

    Advansys Support

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.