I'm trying to connect my program to a DBC database using the tutorial from that link:
The code used is as follows:
string path = @"D:\tabwin\";
string cs = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBC;SourceDB=" + path + "PAPE1701.dbc;Exclusive=No; NULL=NO;Collate=Machine;BACKGROUNDFETCH=NO;DELETED=NO;";
OdbcConnection conn = new OdbcConnection(cs);
conn.Open(); //<<< LINHA COM ERRO
string sql = @"SELECT * FROM pape1701";
OdbcCommand cmd = new OdbcCommand(sql, conn);
OdbcDataAdapter da = new OdbcDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds;
//dataGridView1.DataBind();
conn.Close();
When I run the program, 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
How to fix?