I hope someone can help me. I want to connect to a Microsoft SQL Server 2005 Express Edition database programming in C++. I am using Netbeans (with g++ compiler) platform over Windows because I develop Java applications too.
I have tried to use some libraries (f.e. www.sqlapi.com) but I have a lot of problems because when I try to build the project it goes wrong, although I think I have imported all neccesary libraries.
I donīt know if it is because the library has been programmed with MVS or Borland C++, or simply I have forbidden to import some libraries.
The code I am trying to run is:
Expand|Select|Wrap|Line Numbers
- #include <SQLAPI.h>
- #include <ibAPI.h>
- int main(int argc, char **argv){
- SAConnection con;
- con.setClient(SA_InterBase_Client);
- ibAPI *pibAPI = (ibAPI *)con.NativeAPI();
- ISC_STATUS status_vector[20];
- isc_db_handle db_handle = NULL;
- isc_tr_handle dummy_handle = NULL;
- pibAPI->isc_dsql_execute_immediate(
- status_vector,
- &db_handle,
- &dummy_handle,
- 0,
- "create database 'localhost:c:/test.gdb' user 'SYSDBA' password 'masterkey'",
- 1,
- NULL);
- if (status_vector[0] == 1 && status_vector[1])
- {
- /* Process error. */
- pibAPI->isc_print_status(status_vector);
- return 1;
- }
- return 0;
- }
Have somebody tried to implement that code using Netbeans?
Is it posible to compile (and run) an example from Netbeans using the SQLAPI?
Do you know any C++ Web dedicated to Netbeans platform?
Thank you for your answers.