Create Database

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cooltool
Posts: 10
Joined: Sat 04 Jun 2005 15:29

Create Database

Post by cooltool » Sat 04 Jun 2005 15:40

Hello, what is wrong with this script ? I get a lot of errormessages from SDAC and the DB SQL Monitor when executing the script with SDAC SQLScript

Script: (created with EMS SQL Manager)

CREATE DATABASE [rgea]
ON PRIMARY
( NAME = [rgeadat],
FILENAME = 'C:\Programme\Borland\Delphi7\Projects\rgea.21\daten\rgeadat.mdf',
SIZE = 1 MB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 10 % )
LOG ON
( NAME = [rgealog],
FILENAME = 'C:\Programme\Borland\Delphi7\Projects\rgea.21\daten\rgealog.ldf',
SIZE = 1 MB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 10 % )
GO

Delphi Code to use the script

begin
If Script.FileName>'' Then
Begin
SQLServer.Server:= Servername.Text;
SQLServer.Username:= Benutzer.Text;
SQLServer.Password:= Passwort.Text;
SQLServer.Database:= 'master';
SQLServer.Connected:= True;
SQLScript.SQL.Clear;
SQLScript.SQL.LoadFromFile(Script.FileName);
SQLScript.Execute;
End;
end;

Best regards
Stefan

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 06 Jun 2005 14:09

"GO" in the script is unnecessary. What errors do you have? Try to execute the same script in QueryAnalyzer.

Guest

Post by Guest » Mon 06 Jun 2005 16:10

Hi Ikiar,

thanks for your help,
i removed the go statment and exit Delphi and then i run the program and it worked correctly.

i use MSDE for programming and i have to install the Queryanalyzer from the SQL Server CD. It is a good Program to test the scripts

I thin k that the MSDE had headache that day

Thanks
Stefan

Post Reply