You are not logged in.
Pages: 1
i try connect to sample.dbf,
procedure TForm2.btnADOClick(Sender: TObject);
const
ADOProvider = 'Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=dBASE IV;Persist Security Info=False;Mode=ReadWrite;Data Source=';
var
base: string;
begin
base := 'D:\work\delphi\convbase';
ADOQuery1.ConnectionString := ADOProvider + base;
ADOQuery1.SQL.Text := 'select * from sample';
ADOQuery1.Open;
end;
procedure TForm2.btnSynopseClick(Sender: TObject);
var Props: TOleDBConnectionProperties;
Conn: TSQLDBConnection;
Query: TSQLDBStatement;
F: TFileStream;
begin
Props := TOleDBMSSQLConnectionProperties.Create('Microsoft.Jet.OLEDB.4.0','D:\work\delphi\convbase','','');
try
//Props.ConnectionStringDialogExecute;
Conn := Props.NewConnection;
try
Conn.Connect;
Query := Conn.NewStatement;
try
Query.Execute('select * from sample',true,[]);
F := TFileStream.Create(ChangeFileExt(paramstr(0),'.json'),fmCreate);
try
Query.FetchAllToJSON(F,false);
finally
F.Free;
end;
finally
Query.Free;
end;
finally
Conn.Free;
end;
finally
Props.Free;
end;
end;
but get error
[DBNETLIB][ConnectionOpen (Connect()).]SQL-server not found
i write sample with use ADO, and Synopse http://dl.dropbox.com/u/12662204/convbase.7z
Last edited by noobies (2011-12-07 09:54:11)
Offline
how display results from query to drawgrid like TSQLTableToGrid?
Simply say as quickly display the JSON array in Drawgrid?
Last edited by noobies (2012-01-10 12:02:36)
Offline
Take a look at the DBExplorer sample application.
See e.g. http://synopse.info/fossil/dir?ci=50769 … B+Explorer
You'll find here a way to use a TDrawGrid and display a statement result within.
Offline
Pages: 1