/ Forums / Advansys Formativ / Creating Solutions with Formativ / Can I do an SQL query in a Formativ applet? / Reply To: Can I do an SQL query in a Formativ applet?
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.
quote:
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 arrset conn = createobject(“ADODB.Connection”)
conn.open(“DSN=putDSNHere; User ID=putUseridHere; ” & _
“password=putPasswordHere”)arr = getRecords(“SELECT * FROM putTableNameHere”)
End SubPrivate Function getRecords(query) ‘returns a dwo-dimensional array with results
dim rsset rs = conn.execute(query)
rs.movenext
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