Unix Technical Forum

Re: not possible to create a database

This is a discussion on Re: not possible to create a database within the pgsql Interfaces odbc forums, part of the PostgreSQL category; --> Hi Vincent, Am 04.02.2005 um 11:19 schrieb vincent.richomme@ratp.fr : > With my old application before to store data in ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces odbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 02:03 AM
Christof Glaser
 
Posts: n/a
Default Re: not possible to create a database

Hi Vincent,

Am 04.02.2005 um 11:19 schrieb vincent.richomme@ratp.fr:

> With my old application before to store data in the base I check it
> exists and so I do the following :
>
> m_strConn.Format("DRIVER={PostgreSQL};\
> ***************** SERVER=127.0.0.1;\
> ***************** PORT=5432;\
> ***************** UID=root;\
> ***************** PWD=123456");
>
> // Try to open default database (dbBornes)
> bRet = m_pDb.Open( m_strConn + _T( ";Database=dbBornes" ) );
>
> //Database doesn’t exist so create it
> if ( !bRet){
> bRet = m_pDb.Open(m_strConn);if (!bRet) goto lblExitOnErr;


You must connect with a database name. If you want to create a new
database, you should connect to 'template1'.

> * bRet = m_pDb.Execute( _T("CREATE DATABASE dbBornes;") );if (!bRet)
> goto lblExitOnErr;


Best regards,

Christof Glaser
--
-- gl.aser . software engineering . internet service
-- Doelitzer Strasse 37 . D-04277 Leipzig . fon +49-341-303 20 51
-- http://gl.aser.de/ . sms +49-177-779 28 43 . fax +49-0341-303 20 52


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:01 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com