Der ConnectionString und auch den ganzen Code dazu. Tabelle heisst ausserdem nicht table_1 sondern JMF
CCS = 'Provider=SQLOLEDB.1;' +
'Password=%s;' +
'Persist Security Info=True;' +
'User ID=sa;' +
'Initial Catalog=%s;' +
'Data Source=%s';
DBServer = 'OPEL05';
DBName = 'inout';
PW = '****';
procedure TDatMan.DataModuleCreate(Sender: TObject);
begin
Connect2DB();
end; //================================================== ======================
procedure TDatMan.Connect2DB;
var i : Integer;
strConnection : string;
begin
isConnected := true;
strConnection := Format( CCS, [PW, DBNAME, DBServer]);
for i := 0 to MaxMessages-1 do messages[ i] := '';
idxmsg := 0;
with coInout do begin
try
if Connected then Close;
ConnectionString := strConnection;
Connected := true;
except
if Errors.Count <> 0 then for i := 0 to Errors.Count-1 do begin
if idxmsg < MaxMessages then begin
messages[ idxmsg] := Errors[ i].Description;
Inc( idxmsg);
end;
end;
isConnected := False;
end;
end;
end; //================================================== ======================
function TDatMan.HasNewJMFInfo: Boolean;
var
sql : String;
begin
if qryJMF.Active then qryJMF.Close();
qryJMF.SQL.Clear();
sql := 'SELECT * FROM JMF'; // WHERE EXPORTIERT = 0';
// try
qryJMF.SQL.Add(
sql);
qryJMF.Open();
// >>>>> hier kommt die
Exception <<<<<<
result := qryJMF.RecordCount > 0;
dsJmf.Enabled := True;
{
except
result := False;
end;
}
end; //================================================== ======================
Gross-/Kleinschreibung hilft nicht!!!