Simple? Delphi database questions
- From: "Paul E. Schoen" <pstech@xxxxxxxxx>
- Date: Sun, 25 Feb 2007 17:34:14 -0500
I am adding a database to my PADSplus utility program, which will store
information about all components in the design, and allow editing and other
functions. It will be connected as an automation client to the PADS
program.
I am using Delphi 4. Perhaps you might say I should stop right there and
upgrade to at least D5, where apparently it adds full implementation of the
MDE engine for Access97, rather than the BDE engine of D4. I would prefer
using an Access database, but it would also be OK to use dBaseIV or Excel
format, which could then later be converted if desired.
I made a simple Access database, with three fields: RefDes (Unique Primary
Index), PartType, and Decal, and filled three records with data. Then I
exported in both Excel and dBaseIV format.
My DataSource1 Component is linked to Table1. I have a DBControlGrid1 and
also a DBGrid1 linked to DataSource1. I was able to make it work with
DatabaseName = dBase Files, TableName = BOMDATA, and TableType = ttDBase.
When I try to add an IndexFile, the browser shows BOMDATA.MDX, but when I
try to use it I get an error "Index does not exist". Similarly, if I try to
choose an IndexFieldName, the SelectEdit shows REFDES, but I also get an
error. I was able to choose "PRIMARYKEY" as IndexName, and the data now
seems to be sorted, and the MDX file appears to be updating. Maybe I don't
need to specify a file.
One minor problem is that the sorting is done strictly by ASCII value, so
"a" comes after "Z", but I should be able to fix that. I think the
application program already forces uppercase.
Now, if I try to use "Excel Files", however, I get a "Key Violation" error:
"[ODBC Excel Driver]Not enough info to connect to this DSN with
SQLconnect". I got similar errors with the Access database.
I probably have enough information to proceed with a dBase version, but I
would like to be able to use Excel and Access, or at least know why it
doesn't work now. I do have a book somewhere on Delphi4, so maybe I can
find some clues there.
When my application runs, I always get a login prompt. I know this can be
set to False in TDatabase, but I don't know how to turn this off with just
the TTable and TDataSource.
One final question. I will need a separate database for each document to
which I connect. Can I just create TDatabase components at runtime, or
create TTables?
Thanks,
Paul
.
- Prev by Date: Re: Can't access Application variable in TWebModule...
- Next by Date: React when the program isn't focused
- Previous by thread: Repeat Get_A_Life Until ( New_life=true) or (Shoot_self_in_head=true)
- Next by thread: React when the program isn't focused
- Index(es):
Relevant Pages
|