Operations defined with the Server API can be executed in OLE DB or ADO as commands, and lists of OSTC objects returned by Server operations can be accessed as Rowsets or RecordSets.
What Is OLE DB?
For details about the OLE DB object model, refer to the Microsoft OLE DB SDK. To obtain a complete description of the ADO object model, consult the on-line documentation for Microsoft Visual Basic, Active Server Pages, or Visual C++. For more information about OLE DB and ADO, browse the Microsoft web site at http://www.microsoft.com/data.
Using ADO to Create a Client of the Component Server
In general, to open an OSTC OLE DB connection, provide a string in this format:
provider=ObjectStore Thin Client OLE DB Provider; data source=service-name; [router=router_name:port_number]
For example, using ASP and ADO you can create and open an OLE DB connection to the provider:
Set adoConnection = Server.CreateObject("ADODB.Connection") Call adoConnection.Open( "provider=ObjectStore Thin Client OLE DB Provider; \ data source=service-name" )
Then you can open a RecordSet:
Set RS = Server.CreateObject("ADODB.RecordSet") Call RS.Open("operation-name", adoConnection)
Set aCommand = Server.CreateObject("ADODB.Command") Set aCommand.ActiveConnection = adoConnection Command.CommandText = "operation-name" aCommand.Parameters("arg-name") = arg-value Set RS = aCommand.Execute
The provider supports the following schema tables:
ADO Enumerator | Corresponding OSTC Enumerator |
adBSTR | ostc::string |
adInteger | ostc::int32 |
adBigInt | ostc::int64 |
adSingle | ostc::float |
adDouble | ostc::double |
Use of ADO is subject to the following restrictions:
ISG Navigator/Bridge includes an ODBC driver for OLE DB data sources. It consumes OLE DB providers and allows ODBC applications to access any OLE DB data source. ISG Navigator/Bridge is distributed by ISG International Software Group (http://www.isgsoft.com ) and by Microsoft Corporation(http://www.microsoft.com/oledb/download/download.htm).
Download and install ISG Navigator/Bridge. Then you can configure it to access Component Servers through any ODBC client.
Retrieving Error Information
For example, this code attempts to open a database in an active server page:
On Error Resume Next Set adoConnection = Server.CreateObject("ADODB.Connection") Call adoConnection.Open( "provider=ObjectStore Thin Client OLE DB Provider;\ datasource=testService","","" ) if Err.Number <> 0 then Response.Write("Error# " & Hex(Err.Number) & "<BR>") Response.Write("Generated by: " & Err.Source & "<BR>") Response.Write("Description: " & Err.Description & "<BR>") Exit Sub End If