Re: ADOX - Import type library into Delphi 2007



Howdy!

There has been talks about this before on this topic, but I want to do something which I think Delphi is reluctant to help me with.

I am comparing the structure in the program file and the structure actually found in the MDB file, which Delphi basically tells me not to do.

//Contains what I have in the DB file...
ADOConnection1.GetFieldNames('Progress', FieldsOnDiskList.Items);

//Contains what I want to have! - Defined by the DefFields
ADO_Progress.GetFieldNames(FieldsInClientList.Items);


I get this message (pointing at the second line above):

[DCC Warning] main.pas(882): W1000 Symbol 'GetFieldNames' is deprecated

It does however work and I do detect the differences between the two, so all I then plan to do is adapt the structure on the disk file (adding missing fields in a post). Without ADOX I can't do that!

What I would like to do is update the MDB automatically when the first user runs the new EXE.

I would strongly appreciate any guiding findings from you!

/Pontus

ps: I had to go D2007 to be able to produce a vista compatible version of my program. Something in the old one made it fail working. I don't know if this is a general problem, or personally aimed at myself ;-)


mIKE skrev:
I am anticipating moving as many Delphi 5 apps as possible to D2007 starting soon, and since most of what I do is ADO with SQL-Server and Access MDB on the back end, I will need to know the answer to your question too. If I discover anything, I will let you know. I will also be trying to determine if ADO/ADOX have become superfluous in D2007 Enterprise due to some other available technology. (I think I only use ADOX in one utility program that I use to print table structures.)

In the interim, I looked at the article in that link, and I find that it is slightly different from what worked for me. The article calls for renaming two items that for some reason I found I could not rename without creating some kind of problem. Specifically, I found that I had to leave TKey and TCatalog with their original name.

mIKE

"Pontus Berg" <pontus@xxxxxxxxxxxxxxxxx> wrote in message news:482b581d@xxxxxxxxxxxxxxxxxxxxxxxxx
Howdy!

I asked the same question more than two years ago, and give it a new shot here as I still have got no answers I have been able to use.

I want to modify an Access database at runtime and this takes ADOX (not only ADO but also ADOX so you can f.ex. access the structure of the data and not only the data itself).

Importing a type library is very well described at many informative sites. Take this brilliant example:

http://delphi.about.com/od/database/l/aa072401a.htm

Now; How do I do that in Delphi 2007? It's totally different and renaming is not one of the options.

/Pontus Berg


.



Relevant Pages

  • Re: Help! How do I create a database?
    ... Relatively new to Delphi, but not to programming in general, I would ... ADOX package from inside my form. ... As stated in the mentioned chapter, ADO Extensions for Data Definition Language and Security is an extension to the ADO objects and programming model. ... ADOX gives developers a rich set of tools for gaining access to the structure, security model, and procedures stored in a database. ...
    (alt.comp.lang.borland-delphi)
  • Re: ADOX - Import type library into Delphi 2007
    ... I want to modify an Access database at runtime and this takes ADOX (not ... only ADO but also ADOX so you can f.ex. ... How do I do that in Delphi 2007? ... It's totally different and renaming ...
    (borland.public.delphi.database.ado)
  • Creating Access Database with Delphi
    ... Even though ADOX is part of ADO, Delphi does not wrap it inside ADOExpress. ... Press Install button ... I follow the instructions and all goes well until step 5. ...
    (borland.public.delphi.database.ado)
  • Re: Creating Access Database with Delphi
    ... cat: OleVariant; ... > I am attempting to create an empty Access database using Delphi. ... > To use ADOX with Delphi, you should establish a reference to the ADOX type ... Press Install button ...
    (borland.public.delphi.database.ado)
  • Making mdb read-only after appending tables
    ... I have created an Access mdbthrough VB6 code using ADOX. ... The mdb has to be deleted after processing is finished. ... I did consider creating users for the database like this and then ...
    (microsoft.public.access.security)