D3.0 + MSAccess97 (what else) = problems - HELP! 
Author Message
 D3.0 + MSAccess97 (what else) = problems - HELP!

Hi all,
        Help a poor database&Delphi newbie (I'm not even a professional
programmer, nor I intend to be). I'm writing a small app working on a
MSAccess97 database (no other choice - has to be MSAccess97). In a
database table I have defined an autoincrement field and used it as the
primary key for that table (this is the only indexed field in the table
anyway). The field is at the begining of the structure in Access. It
works well in Access, I can insert and browse my records without any
problems. In delphi (3.0std + BDE upgrade 4.51) I have made a simple
form with just a TTable a datasource, a DBgrid and DBNavigator. I linked
the whole thing to my Access table. It works well for browsing records,
but when I try to insert a new record things start to go wild. The
autoincrement field, instead of getting the next number (as it happens
when I insert a record in Access) is assigned a strange, much higher
number. For example - I enter 4 records in Access and the autoincrement
field is 1,2,3,4 as expected. When I try the same thing in my Delphi
app. I get 81 as the next number!! When I try again I get 114 etc.
        I noticed one strange thing. My database looks OK under Database
Desktop, but when I open it in Database Explorer I see that the
structure of a table is rearranged - isntead of the original order the
fields are ordered alfabetially according to their names. And the
primary key listed is not my primary key defined in Access but just the
first (alfabetically) field in the table (it's not even indexed in
Access). Can this be the reason for problems, and how to get rid of
this. All the modification options in DB Explorer and DB Desktop are
grayed out, I can't modify my structure there (it's READ/WRITE in DBE
Configuration). I'm using the native MSACCESS driver, not the ODBC one.
        Please, help me, I'd hate to have to write my app. in Access Basic.
                                                Pawel Golik
                                                Dept. of Genetics
                                                Warsaw University



Wed, 18 Jun 1902 08:00:00 GMT  
 D3.0 + MSAccess97 (what else) = problems - HELP!

Quote:

> Hi all,
>         Help a poor database&Delphi newbie (I'm not even a professional
> programmer, nor I intend to be). I'm writing a small app working on a
> MSAccess97 database (no other choice - has to be MSAccess97). In a
> database table I have defined an autoincrement field and used it as the
> primary key for that table (this is the only indexed field in the table
> anyway). The field is at the begining of the structure in Access. It
> works well in Access, I can insert and browse my records without any
> problems. In Delphi (3.0std + BDE upgrade 4.51) I have made a simple
> form with just a TTable a datasource, a DBgrid and DBNavigator. I linked
> the whole thing to my Access table. It works well for browsing records,
> but when I try to insert a new record things start to go wild. The
> autoincrement field, instead of getting the next number (as it happens
> when I insert a record in Access) is assigned a strange, much higher
> number. For example - I enter 4 records in Access and the autoincrement
> field is 1,2,3,4 as expected. When I try the same thing in my Delphi
> app. I get 81 as the next number!! When I try again I get 114 etc.

Yeah, my MS ACCESS autoinc fields do that too and I really cannot figure out why.  It
hasn't been a problem for me though.  I would be interested in a solution if you hear
of one.

You could manage the primary key yourself.  Use just a number field and when you want
to insert a record go to the last record of the table first and get the key number
then increment by 1 for the new record.

--
Craig Stocki



Wed, 18 Jun 1902 08:00:00 GMT  
 D3.0 + MSAccess97 (what else) = problems - HELP!



snip.

Quote:
>    I noticed one strange thing. My database looks OK under Database
>Desktop, but when I open it in Database Explorer I see that the
>structure of a table is rearranged - isntead of the original order the
>fields are ordered alfabetially according to their names. And the
>primary key listed is not my primary key defined in Access but just the
>first (alfabetically) field in the table (it's not even indexed in
>Access). Can this be the reason for problems, and how to get rid of
>this. All the modification options in DB Explorer and DB Desktop are
>grayed out, I can't modify my structure there (it's READ/WRITE in DBE
>Configuration). I'm using the native MSACCESS driver, not the ODBC one.
>    Please, help me, I'd hate to have to write my app. in Access Basic.

I don't see why not. Its far easier for a small application. I've just started
learning Delphi and find it a far more sophisticated tool but for throwing
together a simple application Access 97 does most things without you even
needing to write code.

--

Ralph Hilton



Wed, 18 Jun 1902 08:00:00 GMT  
 D3.0 + MSAccess97 (what else) = problems - HELP!

HI,

i have tested your problem and i get the same mistakes as you;
i have make test in 2 way:
writting a small application in delphi 3
and i have try to use the Delphi(small Paradox) access to databases.
each time , like you i get curious numbers for index.....
i can open the tables but i can't add records...
i have always use MS access to build forms which add records....

that is all for this day, if i find someting i shall send it to you...

Jean-Pierre Magne




Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. D3 Pro->MSAccess97 How?

2. Help needed with Cached Updates in msAccess97 db

3. D3.Pdx D2-->D3 partial migration problem

4. HELP: Eschalon Setup BDE problem with D3

5. Tool to needed convert msaccess97 to Delphi 4

6. MSAccess97 boolean fields being returned as smallints??

7. D3.0 and D3.01

8. D3 Bat Moving Problems

9. D3 BatchMoving Problems

10. D3 IB5 Lost connection problem

11. D3/Quickrep 2.0K : Problems with Printerrors

12. D3 and Access95 SQL problems!!

 

 
Powered by phpBB® Forum Software