From: Joseph Date: 2004-06-09T06:04:27+09:00 Subject: [NEWBIE] Howto? Use Windows DataSourceLocator Hi. I'm using ruby 1.8.1 (2003-12-25) [i386-mswin32]. I want to use Window's built-in DataSourceLocator Prompt, in order to interactively retrieve the datasource for an ADO connection to some user selected database. In (Visual) C++ the I found a code snippet that does that. How would I implement equivalent code in Ruby? The Visual C++ code looks like this: =========== C++ Code ============ // IDataSourceLocatorPtr is defined In Oledb32.tlh IDataSourceLocatorPtr dlPrompt = NULL; // code fragment: try { // Instantiate DataLinks object. TESTHR(hr = dlPrompt.CreateInstance(__uuidof(DataLinks)) ); // Prompt for connection information. m_pConnection = dlPrompt->PromptNew(); } =========== End C++ Code =========== How do would I implement equivalent code in Ruby? I've tried a few imaginative variations based on Ernest Ellingson's advice for ADO, but all I get is the following error message: dlPrompt = WIN32OLE.new('Oledb32.DataSourceLocator') HRESULT error code:0x800401f3 Invalid class string from (irb):2:in `initialize' from (irb):2:in `new' from (irb):2 TIA, Joseph