Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ODBC Connectivity to FM Pro

Featured Replies

  • Newbies

I had written an ODBC connector to FM Pro using VB.NET application, where I get data via following two lines that work just fine.

connection.Open("Provider=MSDASQL.1;Data Source=FMTest;User ID=sa;Password=sa;")

recordset.Open("Select * from PMProTest.fp7", connection)

where, connection and recordset are initialized as follows:

Dim connection As ADODB.Connection = new ADODB.Connection

Dim recordset As ADODB.Recordset = new ADODB.RecordSet

However, writing a similar application using C# is failing with exception System.Data.Odbc.OdbcException: [iM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

The C# code looks like this:

// Note: all Odbc* classes are from System.Data.Odbc namespace.

m_Command = new OdbcCommand();

m_Connection = OdbcConnection("Provider=MSDASQL.1;Data Source=FMTest;User ID=sa;Password=sa;")");

m_Connection.Open();

m_Command.Connection = m_Connection;

......

......

m_Command.CommandText = "Select * from PMProTest.fp7";

m_DataReader = m_Command.ExecuteReader(CommandBehavior.Default);

......

......

Anyway, the exception is thrown at call to m_Connection.Open() . Anybody has any idea what I am doing wrong? Only difference between the two application is that I am using ADODB (version 2.8) control in VB and included System.Data.Odbc reference and namesspace in c# solution and code.

Thanks,

Raja.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.