ODBC – API – SQLBindParameter – Date, Time – Timestamp – Error Messages

Background Wanted to highlight a few less than intuitive error messages one can run into when trying to work on dates using the SQLBindParameter. BTW,  our programming language is C and ODBC. Code 1) DATE_STRUCT // SQL_C_TYPE_DATE // SQL_TYPE_DATE Code Output 2) SQL_TIMESTAMP_STRUCT // SQL_C_TYPE_TIMESTAMP // SQL_TYPE_TIMESTAMP Code Output 3) SQL_TIMESTAMP_STRUCT // SQL_C_TYPE_TIMESTAMP // SQL_TYPE_TIMESTAMP … Continue reading ODBC – API – SQLBindParameter – Date, Time – Timestamp – Error Messages

ODBC – SQLBindCol Function – Using Microsoft’s sample code – Code Review

Background A quick follow-up to our original post on using the ODBC SQLBindCol function. Lineage ODBC – SQLBindCol Function – Using Microsoft’s sample code Date Published :- 2020-01-01 Link Microsoft Sample Web Site Tried out Microsoft's sample; available here. Docs / SQL ODBC / ODBC Advanced / Microsoft Open Database Connectivity (ODBC)/  ODBC Programmer's Reference … Continue reading ODBC – SQLBindCol Function – Using Microsoft’s sample code – Code Review

ODBC – SQLBindCol Function – Using Microsoft’s sample code

Background Reading more on ODBC via C. Microsoft Sample Web Site Tried out Microsoft's sample; available here. Docs / SQL ODBC / ODBC Advanced / Microsoft Open Database Connectivity (ODBC)/  ODBC Programmer's Reference / API Reference / ODBC API Reference / SQLBindCol Function SQLBindCol Function Link Compile Tried compiling the code. Output Image   Text … Continue reading ODBC – SQLBindCol Function – Using Microsoft’s sample code

Sharing Code Online – IBM.COM – “SQLDriverConnect() – Use a connection string to connect to a data source”

Background One of the interesting things about blogging is the headache of sharing code online. It is just cumbersome. Sample Courtesy of IBM, here is how teary eye things can be. SQLDriverConnect() - Use a connection string to connect to a data source Link Items Display failure return code Display "completed connection string"; which is … Continue reading Sharing Code Online – IBM.COM – “SQLDriverConnect() – Use a connection string to connect to a data source”

Visual Studio .Net – C++ – ODBC / Database Connection

  Background Using a very nice and well documented code from Easysoft as a sample, wanted to see how to connect and disconnect from an ODBC datasource. Code Outline Function :- ParseCommandLineArguments Get Command Line Arguments int argc char* argv[] Function :- extractODBCError SQLGetDiagRec Function :- Main Function :- SQLAllocHandle SQL_HANDLE_ENV Function :- SQLSetEnvAttr ODBC/Version … Continue reading Visual Studio .Net – C++ – ODBC / Database Connection

Visual Studio .Net – C++ – Compile Error – “error LNK2019: unresolved external symbol _SQLAllocHandle@12”

Background Error linking a very simple ODBC Application written in C. Error Error Image Error Text TroubleShooting Review Compilation Step Command Code Remediation Outline Include the following libraries ODBC32.lib   Code Crediting Crediting Sybase SYBASE - Infocenter SQL Anywhere 12.0.1 > SQL Anywhere Server - Programming > ODBC support> Building ODBC applications Linking ODBC applications … Continue reading Visual Studio .Net – C++ – Compile Error – “error LNK2019: unresolved external symbol _SQLAllocHandle@12”