Einzelnen Beitrag anzeigen

value is NULL

Registriert seit: 10. Sep 2010
249 Beiträge
 
#1

Execute SQL File

  Alt 27. Mär 2012, 13:06
Hi Leute

Hab ein Problem....
Ich will mit dieser Function

Delphi-Quellcode:
function sqlfile(filename : string) : string;
begin
  if not fileexists(filename) then toolsst.exceptionst('SQL File not found!');
  oTmpQry := TADOQuery.Create(nil);
try
  try
    oTmpQry.Connection := Conn;
    oTmpQry.CommandTimeout := 10000;
    oTmpQry.LoadFromFile(filename);
    oTmpQry.Active := True;
    result := 'OK';
  except
    on e : exception do begin
      result := e.Message;
    end;
  end;
Finally
  oTmpQry.free;
end;
end;
ein SQL File script abschießen, welches mir einen Table erstellt. Wenn ich das Script händisch ausführe (SQL Server Management Studio) funktioniert es.

Folgendes bekomme ich retour:

Code:
C:\>test.exe
[20120327] [13:55:44] [DEBUG] Checking if Table exist ...
[20120327] [13:55:44] [DEBUG] Database connect   [OK]
[20120327] [13:55:44] [DEBUG] Table not found! Try to create ...
Exception: CREATE TABLE SQL EXCEPTION: Das Recordset kann anhand der angegebene
Quelle nicht erstellt werden. Die Quellendatei oder der Strom mu▀ Recordsetdaten
 im XML- oder ADTG-Format enthalten

C:\>
Kann mir hier jemand helfen?

LG
Steffen
  Mit Zitat antworten Zitat