Have a look at this page, if you don't know it yet, the examples are C++ (BCB) but the basics are the same.
http://www.gentle.it/alvis
Main Topics
Browse All TopicsHey,
The DbiCreateTable function requires a database handle (HDBIDB) value with regards to the location of the created database, and I'm wondering what the easiest way would be to specify a string instead (or somehow convert it).
I don't have much experience with the HDBIDB property (and there doesn't appear to be much resources on google for it either), and although I know TTables have it, as far as I know they're only accessible if the TTable is open. This means that I can't simply create a "blank" TTable with a Database Name of my intended directory for the sole purpose of this.
As stated above, due to the lack of resources I do not even know how to assign a value to a HDBIDB object manually. Obviously it wouldn't be anything like DatabaseHande := 'c:\temp\'. I suppose it could be possible with DbiGetDirectory (?) though again, I couldn't find much info on this either.
Any help would be appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Have a look at this page, if you don't know it yet, the examples are C++ (BCB) but the basics are the same.
http://www.gentle.it/alvis
Hi,
Are you programming using BDE APIs only? If yes then, as TName already said, use DbiOpenDatabase. If not, you may use TDatabase and TSession components: create them, initialize their parameters (as you would creating GUI app if the database was there), open the database and use Database1.Handle as the first parameter in DbiCreateTable function.
Regards, Geo
Hey TName,
I checked out your link, but the create table example doesn't appear to use DbiSetDirectory or DbiOpenDatabase. Originally, I was only trying to use DbiSetDirectory, and I didn't know that I had to use DbiOpenDatabase prior to creating a table. I did a quick look around for some more information on DbiOpenDatabase, and although borlands website lists it, it only says that examples are in the BDEHelp :/
I've managed to get it working with a TDatabase though, so things should be right. Still, check below about my question about a TQuery.
Hey qeobul,
For now, the database is a BDE Database, but it migh tbe possible in the future that the program will need to work with an interbase database. Therefore, judging by what it sounds, it might be better to use a TDatabse. Fortunately, in both cases they use the same DBAlias, so I should be able to use a TDatabase with that Alias to access both BDE and Interbase databases?
Also, do either of you forsee any problems if this was done via SQL instead? In other words, use a TQuery with the SQL Command "Create Table....". This was my initial plan, but I instead chose to use DbiCreateTable instead.
Business Accounts
Answer for Membership
by: TNamePosted on 2006-08-23 at 03:51:39ID: 17371220
Have you tried to call DbiSetDirectory after DbiOpenDatabase?
aPath);
DbiOpenDatabase // returns a db handle (last param?)
DbiSetDirectory // takes the handle and sets (changes) the path - DbiSetDirectory(aDBHandle,
DbiCreateTable
A handle is very different from a file path, you can't simply convert one to the other. But you can add the information about a file's/directory's location to the data structure in memory referenced by the handle. I think this is more or less what e.g. DbiSetDirectory does.