Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 17th, 2005, 03:22 AM
Dev_ Dev_ is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 6 Dev_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 57 sec
Reputation Power: 0
Database creating in Interbase/Firebird

Here is the source:
Code:
bool CreateDatabase(const char *db_name) 
{ 
   // Constructing database creation query 
   unsigned short query_length = 19; 
   query_length += strlen(db_name); 

   char *create_db_query = new char[query_length]; 
   strcpy(create_db_query, "CREATE DATABASE '"); 
   strcat(create_db_query, db_name); 
   strcat(create_db_query, "'\0"); 

   // Creating the specified database 
   ISC_STATUS_ARRAY sts; 
   isc_tr_handle tr = NULL; 
   isc_db_handle db_handle = NULL; 

   isc_start_transaction(sts, &tr, 1, &db_handle, 0, NULL); 

   if(isc_dsql_execute_immediate(sts, &db_handle, &tr, 0, create_db_query, 1, NULL)) 
      return false; 
    
   isc_commit_transaction(sts, &tr); 

   return true; 
}


After calling the function false value is returned. Where is the error?

Reply With Quote
  #2  
Old April 17th, 2005, 04:01 AM
Dev_ Dev_ is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 6 Dev_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 57 sec
Reputation Power: 0
The problem is solved. I need only to authorize in database.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Database creating in Interbase/Firebird


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway