IDatabaseGetADOConnectionString Method |
To connect to the database we have made it simple to get the connection string, this will only return the string and not build the connection.
This will require some sort of login. Its only possible to call GetADOConnectionString trough the SuperOfficeDB Library, calling it from SOApplication will generate an error.
Namespace: SuperOffice.COM.SuperOfficeDB
Get the ADO connection
This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.
Dim objdb Set objdb = createobject("superofficedb.database") if not objdb is nothing then isOk = objdb.login("<userid>", "<password>") if isOk then Set con = objdb.GetAdoConnection Set rs = con.Execute("select * from associate where type = 1") While not rs.eof msg = msg & rs(1).Value & vbcrlf rs.movenext Wend MsgBox msg, vbinformation + vbokonly, "List of resources" else MsgBox "unable to connect to database" end if else MsgBox "unable to create database object" end if set objdb = nothing
Get the name of the datasource
This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.
Dim objdb Set objdb = createobject("superofficedb.database") if not objdb is nothing then isOk = objdb.login("<userid>", "<password>") if isOk then constr = objdb.GetAdoConnectionString MsgBox constr, vbinformation + vbokonly, "Connection string" set con = CreateObject("ADODB.Connection") con.Open constr Set rs = con.Execute("select * from associate where type = 1") While not rs.eof msg = msg & rs(1).Value & vbcrlf rs.movenext Wend MsgBox msg, vbinformation + vbokonly, "List of resources" else MsgBox "unable to connect to database" end if else MsgBox "unable to create database object" end if set objdb = nothing