12-07-2011, 11:55 AM
Hi,
This might be useful to you.
Regards,
Sankalp
This might be useful to you.
Code:
Function GetDataFromBase(DNS,UID,PWD,QUERY)
Set MyConnection = CreateObject("ADODB.Connection")
Set myrecordset = CreateObject("ADODB.recordset")
MyConnection.ConnectionString ="DSN=" & DNS & "; UID=" & UID & ";PWD=" & PWD
MyConnection.Open
Set myrecordset = MyConnection.Execute(QUERY)
GetDataFromBase = myrecordset(0)
MyConnection.Close
End Function
Regards,
Sankalp