Re: CREATE DATABASE via ADO/OLEDB/ODBC
Posted in 2003
Hi Pedro, I tried the following code in visual basic 6.0 and saw it that it works.. (win2000,csdk 2.80) Dim Cnxn As ADODB.Connection StatusBar1.SimpleText = "Establishing connection..." cnxnstr = "Provider=Ifxoledbc.2;Password=informix;Persist Security Info=True;User ID=informix;Data Source=sysmaster@ol_snoppy" Set Cnxn = New ADODB.Connection Cnxn.Open cnxnstr, "informix","informix" StatusBar1.SimpleText = "Informix connection established. Creating database..." CreateDBSql = "create database test" Set rstTables = New ADODB.Recordset rstTables.Open CreateDBSql, Cnxn, adOpenStatic, adLockReadOnly StatusBar1.SimpleText = "database is created..." Regards, Sadi ----- Original Message ----- From: "Pedro Mendoza" <pedro.mendoza@adpclearing.org> To: "Sadi G'rsoy" <sadi@login.com.tr> Cc: "IIUG" <informix-list@iiug.org> Sent: Tuesday, September 02, 2003 2:01 PM Subject: Re: CREATE DATABASE via ADO/OLEDB/ODBC > Hi Sadi, > > Thanks for your answer, unfortunately, once you are connected to a database > using ADO/OLEDB/ODBC you can not execute a "create database ..." statement, > this will generate an error > > Regards, > Pedro > > ----- Original Message ----- > From: "Sadi G'rsoy" <sadi@login.com.tr> > To: "Pedro Mendoza" <pedro.mendoza@adpclearing.com> > Cc: "IIUG" <informix-list@iiug.org> > Sent: Tuesday, September 02, 2003 10:08 AM > Subject: Re: CREATE DATABASE via ADO/OLEDB/ODBC > > > > Hi Pedro, > > Did you try connecting to the engine by giving the database name as > > sysmaster and run the create database sql then? > > Hope works.. > > > > ----- Original Message ----- > > From: "Pedro Mendoza" <pedro.mendoza@adpclearing.com> > > To: <informix-list@iiug.org> > > Sent: Monday, September 01, 2003 5:12 PM > > Subject: Re: CREATE DATABASE via ADO/OLEDB/ODBC > > > > > > > Gregg/Jonathan, > > > > > > Thank you both for your answers, > > > > > > I had tried your suggestions, but unfortunately without success > > > > > > ADO/IFX OLEDB/IFX ODBC will not let you connect to a database server > > > without specifying a database, and will not, neither, let you issue a > > > "create database ..." statement on a connection, so I have not choice > > > but asking tha DBA to sun the initial script > > > > > > Thanks again, > > > Pedro > > > > > > "Gregg Walker" <gregg@rrmca.com> wrote in message > > news:<qJ44b.229263$cF.74766@rwcrnsc53>... > > > > > > > > > > > > > sending to informix-list