Subject RE: [firebird-support] Progmatically Create a Firebird DB
Author Moravecz László (eMeL)
It's Borland C++Builder code, but components same;))

Params->Clear();
Params->Add("USER " + AnsiString(UserName));
Params->Add("PASSWORD " + AnsiString(PassWord));
Params->Add("PAGE_SIZE " + AnsiString(CreatePageSize));

if ((CreateSecondaryFiles > 0) && (CreateSecondaryFilePages > 0))
{
AnsiString FilePath = ExtractFilePath(DatabaseName);
AnsiString FileName = ExtractFileName(DatabaseName);
AnsiString FileExt = ExtractFileExt(FileName);

FileName = FileName.SubString(1, FileName.Length() -
FileExt.Length());

Params->Add("LENGTH " + AnsiString(CreateSecondaryFilePages)); // for
main GDB file

for (int iLoop = 1; (iLoop <= min(CreateSecondaryFiles, 99)); iLoop++)
{
AnsiString FileCounter = AnsiString(iLoop);

if (iLoop < 10)
{
FileCounter = "0" + FileCounter;
}

Params->Add("FILE '" + FilePath + FileName + "_" + FileCounter +
FileExt + "'");

if (iLoop < min(CreateSecondaryFiles, 99))
{
Params->Add("LENGTH " + AnsiString(CreateSecondaryFilePages));
}
}
}


Params->Add("DEFAULT CHARACTER SET " + CreateCharacterSet);

TIBDatabase::CreateDatabase();

// Database created, opened.



> -----Original Message-----
> From: Luke Young [mailto:jinwah50@...]
> Sent: Wednesday, January 28, 2004 12:18 PM
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Progmatically Create a Firebird DB
>
>
> Very slightly OT sorry...
>
> How can I create a Firebird .FDB from Delphi. I do not have any
> proprietry componets just the standard interbase set supplied with
> Delphi 6 Pro.
>
> TIA
>
> Luke
>
>
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/firebird-support/
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>