Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

sourcename

When using
hXO = XOInstance (sourcename, sourcetype, loginID, password, timeout, options, scope)
In the past I have created the Sourcename by using Client / Service Workspace. Is it possible to create sourcename of type ODBC programmatically?

Comments

  • Jim,

    One way to do this is to create an entry in SYSREPOSDATASOURCES programmatically. You will probably want to use the Repository function to do this as I am sure that XOInstance will use the Repository to get access to this record.

    The other way to do this is to switch over to ADO and using the COM functions: OleGetProperty, OlePutProperty, and OleCallMethod. That will allow you to do everything dynamically without needing to store anything within the OI system tables.
  • OK, I'll try that.

    Moving to ADO seems like it might be a lot of work. What advantages would ADO have? Is it faster?
  • Jim,

    I cannot tell you if performance is faster. I think all of this goes through the same API sooner or later. ADO is just more flexible and is the solution Microsoft is promoting again after they came to realize that OLE DB is not a viable alternative.

    ADO is also what the SQL Connector is based on. This eliminates the need to have ODBC connections defined for each workstation. The ODBC drivers need to be installed, of course, but you do not have to worry about going to each one and configuring it.
  • From Carl Pates "I believe that internally the XOInstance code uses SQLConnect() which expects the name of a DSN file, rather than SQLDriverConnect() which doesn't, hence I don't think you can get away without defining the ODBC connection on the local workstation."

    Does this mean I can not simply create the SYSREPOSDATASOURCES record?
  • Jim,

    Well Carl has the advantage of seeing the internal code so he would know better than me. However, my comments come from multiple conversations with Bob Carten, who is using ADO to create the OpenInsight SQL Connector. Here is a comment he sent me on 01/15/2010:
    In meantime, I am having good success with ADO. The SQL bfs works by pulling the SQL statements from datasets, but using ADO rather than the ODBC libraries.

    The immediate bang for the buck is that you do not need to configure ODBC connections on each workstation.
Sign In or Register to comment.