08-09-2010, 05:09 PM
Make a function and use dataTable.
Here I am using Datasheet ,so I don't need to pass DSN,UserName and Password everytime. Everytime I just need to call the function DSN() and it will directly fetch values from the datasheet.
Hope this will help you.Let me know if you have more queries.
~Regrads
Code:
Function DSN()
Dim Oconn
Set OConn = createObject("adodb.connection")
DSN=DataTable["DSN",dtGlobalSheet];Description=desc;UID=Datatable["UserName",dtGlobalSheet];PWD=DataTable["Password",dtGlobalSheet];APP=;WSID=;DATABASE=;"
oConn.Open DSN
End Function
Hope this will help you.Let me know if you have more queries.
~Regrads