Sending OBDC Data Source connection with Add-in or Creating it through JSLHi all,
I am trying to create an Add-in that pulls data from an SQL Server as data source, and I would need to distribute this Add-in to other users.
The Add-in works perfectly, but the OBDC connection used by the Add-in is not being sent with it. Unfortunately, not everyone would be able/know how to create an OBDC connection to the SQL server in an easy way.
Does anyone know how I could either send the OBDC connection with the Add-in file, or re-create this OBDC connection through a JSL script?
Thanks for the help in advance!
Re: Sending OBDC Data Source connection with Add-in or Creating it through JSLI have faced a similar problem with ODBC connection to an Oracle database.
Each user will need an SQL server ODBC driver installed. As @ih mentioned you can probably figure out a way to connect without a named data source (DSN).
Our users access a server version of JMP running on the Citrix platform. So I only needed to install the addin + database drivers once.
Re: Sending OBDC Data Source connection with Add-in or Creating it through JSLIt seems to work like a charm
Still I might need to find out a way to get the SQL OBDC driver installed if they are missing this, but it is defenetly saving me from the DSN.
I was trying to do it using Open Database() as below, but your solution gets rid of the DSN.
Thanks!
Open Database(
"DSN=sqldatasource;Description=sqlescription;Trusted_Connection=Yes;APP=JMP;WSID=sqlserverhostname;DATABASE=databasename;",
"SELECT * FROM [sqldatabasename].[schema].[table]");
Re: Sending OBDC Data Source connection with Add-in or Creating it through JSLIf you only need to access SQL databases from windows, or if the user has a SQL odbc driver installed then this this might work without configuring a DSN on the client machine:
New SQL Query(
Connection(
"ODBC:DRIVER=SQL Server;SERVER=sqlserverhostname\sqlinstancename;Trusted_Connection=Yes;APP=JMP;DATABASE=sqldatabasename;"
),
CustomSQL( "SELECT TOP 10 * FROM [sqldatabasename].[schema].[table]" ) // database/schema names are not necessary
) << Run