IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New OLE DB -- properties?

This is a crossover problem -- I'm accessing an MS SQL Server database from SAS on Windows 2000 via OLE DB. I've decided that the problem area is OLE which is Microsoft shite technology, hence placement here.

\r\n\r\n

Some of the following may be specific to SAS, but I'm trying to work out how to get the general properties for an OLE DB connection.

\r\n\r\n

I'm trying to work out the syntax for this, docs and Google offer thin comfort. SAS Tech support doesn't know any better (first tier anyhow) either.

\r\n\r\n

I've an ODBC data source configured to an MS SQL database server. This connection used as an ODBC source works flawlessly.

\r\n\r\n

I've configured an OLE-DB (OLEDB) connection to this ODBC source using a UDL file, foo.udl. This specifies the ODBC connection to use, but nothing else (bless Microsoft's binary configuration formats, there's no useful way I'm aware to dump the settings here).

\r\n\r\n

I can connect to this source interactively, selecting the "provider"\r\n("Microsoft OLE DB Provider for ODBC Drivers") and "data source" ("SQLDB" as configured).

\r\n\r\n

Trying to set up a noninteractive connection has stumped me. Best I've come up with is:

\r\n\r\n
\r\n
\r\n    proc sql;\r\n    connect to oledb as bar\r\n        provider='Microsoft.Jet.OLEDB.4.0'\r\n        properties=('data source'='Desktop/foo.udl')\r\n        );\r\n
\r\n
\r\n\r\n

...which results in an error.

\r\n
--\r\n
Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]\r\n
[link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]\r\n
What part of "gestalt" don't you understand?\r\n
[link|http://twiki.iwethey.org/twiki/bin/view/Main/|TWikIWETHEY] -- an experiment in collective intelligence. Stupidity. Whatever.\r\n
\r\n
   Keep software free.     Oppose the CBDTPA.     Kill S.2048 dead.\r\n[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html]\r\n
New "noninteractive" meaning you supply name and password?
In code? I know nothing about OLE DB, but AFAIK you should set that name/password pair in the ODBC properties, no?

Or are you trying to set name and pass on the fly for a good reason?

Many fears are born of stupidity and ignorance -
Which you should be feeding with rumour and generalisation.
BOfH, 2002 "Episode" 10
New What error?
What error is it giving you?

I don't know anything about SAS, so I can't say anything about the general formating but I have used ODBC and OLEDB some. The one thing I see that looks wrong in what you have below is that properties are set as one string normally, that is 'data source=Desktop/foo.udl' rather then 'data source'='Desktop/foo.udl'.

Jay
New Partial solution

That UDL binary file renders as text if the first two gratuitous bits are stripped off:

\r\n\r\n
\r\ndd if=foo.udl bs=1 skip=2\r\n
\r\n\r\n

...which gives the information I'd wanted. Unfortunately SAS doesn't seem to want to maintain a persistent connection, which makes actually using the connection somewhat difficult....

--\r\n
Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]\r\n
[link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]\r\n
What part of "gestalt" don't you understand?\r\n
[link|http://twiki.iwethey.org/twiki/bin/view/Main/|TWikIWETHEY] -- an experiment in collective intelligence. Stupidity. Whatever.\r\n
\r\n
   Keep software free.     Oppose the CBDTPA.     Kill S.2048 dead.\r\n[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html]\r\n
New Full solution

OK, with the data retrieval methods indicated earlier, we've got her licked. Part of my remaining problem was that I was calling the connection by a name other than the alias I'd assigned it. The following works:

\r\n\r\n
\r\n
\r\n484  /* Get OLEDB connection info */\r\n485  proc sql;\r\n486      connect to oledb as bar (\r\n487          Provider=MSDASQL.1\r\n488          properties=("Data Source"="SQLDAT")\r\n489          );\r\n490      select * from connection to bar (select * from sysfiles);\r\n491  quit;\r\nNOTE: PROCEDURE SQL used:\r\n      real time           0:00:00.03\r\n      cpu time            0:00:00.01\r\n
\r\n
\r\n\r\n

Note that the name of the connection in the second statement matches the alias above. I was stumbling on that minor detail....

\r\n\r\n

Connection settings were uncovered using the dd trick above, and with the &SYSDBMSG SAS automatic macrovariable (%PUT &SYSDBMSG; immediately following an interactive connection).

--\r\n
Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]\r\n
[link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]\r\n
What part of "gestalt" don't you understand?\r\n
[link|http://twiki.iwethey.org/twiki/bin/view/Main/|TWikIWETHEY] -- an experiment in collective intelligence. Stupidity. Whatever.\r\n
\r\n
   Keep software free.     Oppose the CBDTPA.     Kill S.2048 dead.\r\n[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html]\r\n
     OLE DB -- properties? - (kmself) - (4)
         "noninteractive" meaning you supply name and password? - (tseliot)
         What error? - (JayMehaffey)
         Partial solution - (kmself)
         Full solution - (kmself)

I KNOW I shouldn’t think about it, I’ll scare myself to death but after seventeen hours in the air, I can’t get the worst case scenario out of my head.

No, not a plane crash. I’m convinced that I am breathing more farts than air.
56 ms