<html>
<head>
<style>
.sw_message P{margin:0px;padding:0px;}
.sw_message {FONT-SIZE: 12pt;FONT-FAMILY:Tahoma,Arial,Helvetica,sans-serif;background:white;}
.sw_message blockquote{margin-left:5px;padding-left:5px;border-left:2px solid #144fae;color: #144fae;}
.sw_message blockquote blockquote{border-left:2px solid #006312;color: #006312;}
.sw_message blockquote blockquote blockquote{border-left:2px solid #8e5656;color: #8e5656;}
.sw_message blockquote blockquote blockquote blockquote{border-left:2px solid #888;color: #888;}
</style>
</head>
<body class="sw_message">
<div>Hi,</div><div><br></div><div>I created a very simple little application that takes 2 parameters, then creates a empty FDB (firebird) database, then runs 4 script files to populate the database with default tables and data.</div><div><br></div><div>This little console application works perfectly under Linux and FreeBSD, but fails under Windows. Currently testing with Win2000 (32-bit).</div><div><br></div><div>Here is the code that causes the AV.</div><div><br></div><div>-----------------------</div><div><div>procedure TMyApplication.CreateEmptyDatabase;</div><div>var</div><div> LHost: string;</div><div> LDBName: string;</div><div> n: integer;</div><div>begin</div><div> n := Pos(':', FDBLocation);</div><div> LHost := Copy(FDBLocation, 1, n-1);</div><div> LDBName := Copy(FDBLocation, n+1, Length(FDBLocation)-n);</div><div><br></div><div> conn := TIBConnection.Create(self);</div><div> conn.Dialect := 3;</div><div> conn.HostName := LHost;</div><div> conn.DatabaseName := LDBName;</div><div> conn.UserName := 'sysdba';</div><div> conn.Password := 'masterkey';</div><div><br></div><div> writeln('Creating database... ', conn.HostName + ':' + conn.DatabaseName);</div><div> conn.CreateDB;</div><div> conn.Connected := True; // <<------- This causes the AV under Windows</div><div>end;</div></div><div>-----------------------</div><div><br></div><div>Here is the console output of when I run the program.</div><div><br></div><div>-----------------------</div><div><div>c:\programming\m2_system\Scripts>makedb -d '127.0.0.1:c:\programming\data\m2_dl_3019.fdb'</div><div>Creating database... '127.0.0.1:c:\programming\data\m2_dl_3019.fdb'</div><div>exception at 00431BD8:</div><div> : CreateDB :</div><div> -I/O error during "open" operation for file ""</div><div> -database or file exists.</div></div><div>-----------------------</div><div> </div><div><br></div><div>I'm using FPC 2.6.2 32-bit on Windows 2000. Any clues what is wrong? And why does this code work on Linux and FreeBSD. Also, even though the error mentions the fact that the "database or file exits", that is definitely NOT true. There is no existing *.fdb file.</div><div><br></div><div id="editor_signature">Regards,<div> - Graeme -</div><div><br></div><br></div><div> </div>
</body></html>