views:

187

answers:

1

Hi All,

Can anyone please help me with the following code:

using System;
using System.Data;
using System.Data.Odbc;

public class test
{
    public static void Main(string[] Args)
    {
        OdbcConnection myConnection = null;

        try
        {
            myConnection = new OdbcConnection();
            myConnection.ConnectionString = "Driver={Lotus NotesSQL 3.01 (32-bit) ODBC DRIVER (*.nsf)};Database=MyDB;";
            myConnection.Open();

            Console.WriteLine("Success");
        }
        catch(Exception e)
        {
            Console.WriteLine(e);
        }
        finally
        {
            if(myConnection.State ==  ConnectionState.Open)
            {
                myConnection.Close();
            }
            Console.ReadLine();
        }
    }
}

Whenever I run this code, I get the following error:

System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I have lotus notes installed with Domino Designer 6.5.5.

I have looked around but just can't seem to find any solution to this issue, any help really appreciated.

Thanks Gareth

+2  A: 

Just to be sure, do you have NotesSQL installed? The error message looks like the driver is missing...

Anders Lindahl