Is there a way to create Access databases (.mdb) without actually using Ms Access? I would like my application to create it instead (when the user clicks "New Document" on the toolbar).
I am using Delphi 5 Ent.
Thanks in advance!: -)
Yes, there is a way if you use the ADOX library. This is an ActiveX library that you can import into Delphi. Then you can create a new database with the code below. See here .
procedure TForm1.btnNewDatabaseClick(Sender: TObject); var DataSource : string; dbName : string; begin dbName:='c:\aboutdelphi.mdb'; DataSource := 'Provider=Microsoft.Jet.OLEDB.4.0' + ';Data Source=' + dbName + ';Jet OLEDB:Engine Type=4'; ADOXCatalog1.Create1(DataSource); end;
Here's how to do it:
procedure CreateNewDatabase; var AdoxCatalog: Catalog; begin AdoxCatalog := CoCatalog.Create; AdoxCatalog.Create(ConnectionString + 'Jet OLEDB:Engine Type='+IntToStr(Jet4x)+';'); end;
ADOX_TLB, , "Microsoft ADO Ext. 2.8 DDL ".
Source: https://habr.com/ru/post/1771314/More articles:Mule JMS Queue Configuration Recommendation - jmsAndroid: как создать ContextMenu для пользовательского представления - androidHow to convert ViewBox to ImageSource? - wpfJavascript Class + Properties do not match their values - javascriptJQuery UI Sortable - restriction for individual elements - jqueryUsing jQuery to display a modal Wait message - jqueryfirefox does not display rss feed with interface - firefoxHow to distribute a Jython application among users? - jythonLINQ or Entity Framework creates unlimited SQL statement - c #Условное количество изменений во времени? - conditional-operatorAll Articles