Subj : ODBC + MySQL + borland bc55 compiler HOWTO?? To : borland.public.cpp.borlandcpp From : Paweł Tatera Date : Mon Jan 24 2005 10:13 pm Hello here's a small part of simple program I'm going write to connect with MySQL server via ODBC (Windows). ---------------------------------------------------------------------------- ---- include //Standard i/o libarary #include //To manipulate input strings setw().... #include //string operations strcpy()... //To get ODBC functionality #include #include #include int main(){ char rhost[50], ruser[20], rpassword[20], rdatabase[20]; cout << "\nRemote host? "; cin >> setw(50) >> rhost; cout << "User? "; cin >> setw(20) >> ruser; cout << "Password? "; cin >> setw(20) >> rpassword; cout << "Database to connect? "; cin >> setw(20) >> rdatabase; cout << "\nReceived info:\n" << "Host: " << rhost << endl << "User: " << ruser << endl; cout << "Password: " << rpassword << endl << "Database: " << rdatabase << endl; cout << endl << "Connecting..." << endl; //SQL Connection Part SQLHENV henv1; //Environment handler SQLHDBC hdbc1; //Connection handler SQLHSTMT hstmt; //Statement handler //Create environment for SQL operations SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv1); //Select database driver SQLConnect(hdbc1, rhost, strlen(rhost), ruser, strlen(ruser), rpassword, strlen(rpassword)); .. .. .. } ---------------------------------------------------------------------------- ---- Don't know why but it doesn't want to compile: "bcc32 file.cpp" gives Unresolved extternal 'SQLAllocHandle' from file.obj and prints the same errof for each of ODBC/SQL functions. I tried to do it in two steps first called a bcc32 -c file.cpp to get file.obj then used an incremental linker "ilink32 file.obj,,,odbc32.lib" - doesn't work either. Creates a 2KB non w32 application code. Also tried to link the obj with import32.lib, cw32.lib and myodbc3.lib to create executable - the result was the executable has been created without errors but it doesn't want to run -generats some memory violations on w2k. Can You help me tell? -- Moim programem pocztowym jest Opera: http://www.opera.com/m2/ .