472,976 Members | 1,432 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,976 software developers and data experts.

Connect to SQL Server Database using C++ language and NetBeans platform


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
  1. #include <SQLAPI.h>
  2. #include <ibAPI.h>
  3. int main(int argc, char **argv){    
  4.     SAConnection con;    
  5.     con.setClient(SA_InterBase_Client);    
  6.     ibAPI *pibAPI = (ibAPI *)con.NativeAPI();    
  7.     ISC_STATUS status_vector[20];    
  8.     isc_db_handle db_handle = NULL;    
  9.     isc_tr_handle dummy_handle = NULL;    
  10.     pibAPI->isc_dsql_execute_immediate(        
  11.         status_vector,        
  12.         &db_handle,        
  13.         &dummy_handle,        
  14.         0,        
  15.         "create database 'localhost:c:/test.gdb' user 'SYSDBA' password 'masterkey'",        
  16.         1,        
  17.         NULL);    
  18.     if (status_vector[0] == 1 && status_vector[1])    
  19.     {        
  20.         /* Process error. */        
  21.         pibAPI->isc_print_status(status_vector);        
  22.         return 1;    
  23.     }     
  24.     return 0;
  25. }
It is an example code from www.sqlapi.com using the especific API.
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.
Feb 27 '08 #1
1 6143
9,208 Expert Mod 8TB
As long as your libraries are compiled for g++, then you should be good to go. Otherwise, you will have problems.
Feb 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Development at American Savings | last post by:
I'm having some trouble being able to connect to my db2 server (it lives on an os/2 warp 3 connect box) from my Windows2000 workstation using vs.net 2003. Any suggestions? I have a local user...
by: Scott Holland | last post by:
HELP - Need to connect to DB2 database on AIX from NT server. Also AS/400 from NT Server -- I am experienced in ORACLE and a novice at DB2. What tools would be the equivalent of Net*8 or...
by: Fabian Knopf | last post by:
Hi friends, i have a unix machine PC1 where a database is running ( IBM DB2 V8.1 ) . Then i have another machine PC2 i installed there also ( IBM DB2 V8.1 ). On PC2 i installed unixODBC. To...
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit...
by: Steven C | last post by:
Hello! I am trying to connect to a SQL Server (MSDE) database in mixed mode authentication, via C#, but when I use the MSDE instance name, I keep getting an "Unrecognized Escape Sequence"...
by: MSK | last post by:
Hi, I am a newbie to .NET/Networking if I develop a project in 1. VB.NET + SQL server database 2. ASP.NET + SQL server database 3. .NET ( vb or asp) + Access database
by: arasub | last post by:
ep 20, 2007 11:25:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found...
by: rhitam30111985 | last post by:
hi all .. java/jdbc newbie here ... i cant seem to perform the most basic step for database connectivity using java . here is my code : import java.sql.*; public class connect { ...
by: zgh1970 | last post by:
Hi, All, I have some question on the alternate server for the DB connection on db2 connect server. There is one db2 connection to one host database on the server with the following cfg: ...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.