Board index » delphi » Creating and Access DB on-the-fly
Michael R. Simpson
![]() Delphi Developer |
Mon, 24 Jul 2000 03:00:00 GMT
|
Michael R. Simpson
![]() Delphi Developer |
Mon, 24 Jul 2000 03:00:00 GMT
Creating and Access DB on-the-flyI'm trying to re-program a Visual Basic application to Dephi 3. In my VB Is there anyway I can do this using Delphi 3 and the BDE. Visual basic is I know how to manipulate an existing Access database, but not how to create Mike Simpson |
Jody Snowdo
![]() Delphi Developer |
Tue, 25 Jul 2000 03:00:00 GMT
Re:Creating and Access DB on-the-flyQuoteMichael R. Simpson wrote: TABLE, data manipulation stuff. Also have a look at the same statements in the Access help as the SQL statements have to be syntactically correct for Access. Something like the following will make you a table in access CREATE TABLE NewTable (FieldOne TEXT, FieldTwo TEXT, ,...., FieldN DATATYPE); Also need to add index and key information into the definition but this Jody. |
Bill Todd (Tea
![]() Delphi Developer |
Tue, 25 Jul 2000 03:00:00 GMT
Re:Creating and Access DB on-the-flyI got this code from another user but I have not tested it. ...............cut here ...................... {version and encryption options} procedure CreateJetDatabase(const FileName: string; Bill (Sorry but TeamB cannot answer support questions received via email.) |
Brian Bushay Tea
![]() Delphi Developer |
Tue, 25 Jul 2000 03:00:00 GMT
Re:Creating and Access DB on-the-flyQuote>I'm trying to re-program a Visual Basic application to Dephi 3. In my VB follows. Tables can be created in Delphi with CreateTable and with SQL ................. {version and encryption options} procedure CreateJetDatabase(const FileName: string; procedure TForm1.Button1Click(Sender: TObject); -- |
Michael Simpso
![]() Delphi Developer |
Wed, 26 Jul 2000 03:00:00 GMT
Re:Creating and Access DB on-the-flyBrian Bushay TeamB <BBus...@DataGuidance.com> wrote in article Quote
Thanks for the reply (as well as the other responders to my plea for help). I tried the above code ( with JET DAO 3.5) and got an Ole error when creating the OLE object. Upon examining the registry I found a 'DAO.DBEngine.35' label and when I substituted it for the DAO.DBEngine param, my program made more progress. It then crashed at the CreateDatabase line with an error: "Unable to find installable ISAM". Since the Access .MDB database file is not part of the ISAM file list, I have to assume that the JET object is mixed up about the creation of the desired database type. The workspase and createdatabase calls are similar to those I used in VB, so the culprit is probably the CreateOleObject code but I'm not sure why. I have both VB 5.0 and Access 97 on my computer and they are properly registered. Any further help appreciated.. Michael Simpson |
Michael Simpso
![]() Delphi Developer |
Wed, 26 Jul 2000 03:00:00 GMT
Re:Creating and Access DB on-the-flyBill Todd (TeamB) <Bill_T...@compuserve.com.nospam> wrote in article Quote> procedure CreateJetDatabase(const FileName: string; Thanks for the reply (as well as the other responders to my plea for help). I tried the above code ( with JET DAO 3.5) and got an Ole error when creating the OLE object. Upon examining the registry I found a CLSID 'DAO.DBEngine.35' label and when I substituted it for the DAO.DBEngine param, my program made more progress. It then crashed at the CreateDatabase line with an error: "Unable to find installable ISAM". Since the Access .MDB database an installable ISAM, I have to assume that the JET object is mixed up about the creation of the desired database type. The workspase and createdatabase calls are similar to those I used in VB, so the culprit is probably the CreateOleObject code but I'm not sure why. I have both VB 5.0 and Access 97 on my computer and they are properly registered. Any further help appreciated.. Michael Simpson |
Brian Bushay Tea
![]() Delphi Developer |
Thu, 27 Jul 2000 03:00:00 GMT
Re:Creating and Access DB on-the-flyQuote>he workspase and createdatabase calls are similar it. Beyond that all I can tell you is I have personaly tested the code and it works for me. I have Access97 installed on my machine. -- |
Michael Simpso
![]() Delphi Developer |
Thu, 27 Jul 2000 03:00:00 GMT
Re:Creating and Access DB on-the-flyBrian Bushay TeamB <BBus...@DataGuidance.com> wrote in article Quote
tried the program on both my work and home computers (200 MMX win95 machines) and on both machines I get a raised exception 'Ole error 80040112' when I hit the CreateOleObject line of code. I Don't know what that error number references? Michael Simpson |
Michael Simpso
![]() Delphi Developer |
Thu, 27 Jul 2000 03:00:00 GMT
Re:Creating and Access DB on-the-flyBrian Bushay TeamB <BBus...@DataGuidance.com> wrote in article . Quote> The CreateOleObject needs ComObj in the USES of the unit where you use ';LANGID=0x0409;CP=1252;COUNTRY=0';) using DBEngine := CreateOleObject ('DAO.DBEngine.35'); and it WORKED: I thought I had tried that combo but apparantly not. Thanks a lot. (for some reason it still does not work using the 'DAO.DBEngine' CLSID. Thanks much |
2. Create DB Controls on the fly on a Secondary Form
3. create Database in a fly with InterBase in a fly
4. Creating an Access database file on the fly
5. Creating access database on the fly
6. How to create Access DB via Delphi?
7. Creating an Access DB from within Delphi.