Unable to connect to virtuoso via ODBC

I’m unable to connect to Virtuoso via ODBC. It returning Exception thrown: ‘System.Data.Odbc.OdbcException’ in System.Data.dll
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

This is my code below:

String conParam = “DRIVER={OpenLinkVirtuoso};SERVER={127.0.0.1:1111};DATABASE=DB;UID=dba;PWD=dba”;
oConnection = new OdbcConnection(conParam);
try
{
//Open the connection
oConnection.Open();
//Notify the user that the connection is opened
Console.WriteLine(“The connection is established with the database”);
}
catch (OdbcException caught)
{
Console.WriteLine(caught.Message);
Console.Read();
}

@de1sage: The name of the Virtuoso ODBC Driver on Windows is OpenLink Virtuoso (with a space between the words) and not OpenLinkVirtuoso (without a space) as in your code snippet and hence the most probable cause of the [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified error.

1 Like