0

I want to access a Windev database from C# through the HFSQL ODBC driver.

static void Main(string[] args)
        {
            try
            {                
                OdbcConnection MyConnection =
                new OdbcConnection(
                "Driver={HFSQL};" +
                "ANA=w:\\C7.wdd;" +
                "Server Name =10.90.6.20;" +
                "Server Port =4900; " +
                "Database =DBASE; " +
                "UID =user; " +
                "PWD =1234;");
                
                MyConnection.Open();
                
                MyData.Close();
                MyConnection.Close();
            }
            catch (OdbcException eExcpt)
            {
                // Display the errors
                Console.WriteLine("Source = " + eExcpt.Source);
                Console.WriteLine("Message = " + eExcpt.Message);
            }
            // pause before exiting
            Console.ReadLine();
        }

MyConnection.Open(); sends this error:

Source =
Message = ERROR [08001] <DvDecEntete> file already defined.
Debugging information:
IEWDHF=32.2
Module=<WDHF>
Version=<26.0.313.5>

All parameters are ok!

What's the problem? And what is the solution?

rgettman
  • 176,041
  • 30
  • 275
  • 357
BuhX
  • 11
  • 2
  • From cmd.exe >Netstat -a which will give you all the TCP and UDP connection on machine. Check if there is an existing connection with same Source IP, Destination IP, and Port number. It sound like there is an existing connection that is already open with the same 3 parameters. – jdweng Mar 18 '22 at 13:30
  • There is no connection to that IP address. – BuhX Mar 18 '22 at 15:11

1 Answers1

0

It was solved. The database was in French, using the OLE and ODBC ascii character sets to name the tables. One of the tables had a special French "ê" in its name, and the same table was created with a normal ascii name. The OLE / ODBC interface could not distinguish between the two tables, so there was an error.

BuhX
  • 11
  • 2