BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error on Windows XP Professional

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop)
View previous topic :: View next topic  
Author Message
Evandro Dugnani
Guest





PostPosted: Wed Sep 15, 2004 2:11 pm    Post subject: Error on Windows XP Professional Reply with quote



Hi everybody,

Did anybody have problems using TTable on an aplication under Windows XP
Professional?
I have an aplication that works fine on Windows 2000 Professional (my
SO), but when a client executes it under WinXP an exception occurs.
The code is like the following:

Table1->Active = false;
Table1->TableName = "Teste";
Table1->TableType = ttDBase;

// Creating the table
Table1->FieldDefs->Add("PROCESSADO", ftBoolean, 0, true);
Table1->FieldDefs->Add("NUM_SELECAO", ftInteger, 0, true);
Table1->FieldDefs->Add("EDITADA", ftBoolean, 0, true);
Table1->FieldDefs->Add("AREA_COBERTA", ftFloat, 0, true);
Table1->FieldDefs->Add("AREA_ANALISADA", ftInteger, 0, true);
Table1->FieldDefs->Add("RESOLUCAO", ftInteger, 0, true);
Table1->FieldDefs->Add("ANALISE", ftString, 30, true);
Table1->FieldDefs->Add("DPM", ftInteger, 0, true);
Table1->FieldDefs->Add("MASCARA", ftGraphic, 0, true); //ftGraphic
Table1->CreateTable();

//... other not related code

// Saving data
Table1->Active = true;
Table1->Append();
Table1->FieldByName("PROCESSADO")->AsBoolean = false;
Table1->FieldByName("NUM_SELECAO")->AsInteger = 1; // *** !!! AN EXCEPTION
OCCURS HERE !!! ***
Table1->FieldByName("EDITADA")->AsBoolean = true;
Table1->FieldByName("AREA_COBERTA")->AsFloat = 0.0; // if I comment the
line above that causes the exception, then the exception occurs here!!!
//... other fields filling

Table1->Post();
Table1->Active = false;

Any tips??

Thanks in advance,

Evandro Dugnani


Back to top
Stig Ove H
Guest





PostPosted: Wed Sep 15, 2004 3:29 pm    Post subject: Re: Error on Windows XP Professional Reply with quote



Not that I'm the expert, but I'm fairly sure 'bout this one.
It states clearly in BCB help:"Call FieldByName to retrieve field
information for a field when only its name is known."
This is a method to READ values from a table/Dataset.

What I would use to write to one specific field would be "FieldValues": "Use
FieldValues to read and write values for fields in a dataset.

Ex:
Table1->FieldValues["PROCESSADO"] = false;

Workz for me anyways.
Happy punching :)


Back to top
Jayme Jeffman Filho
Guest





PostPosted: Wed Sep 15, 2004 6:39 pm    Post subject: Re: Error on Windows XP Professional Reply with quote



Hello Evandro,

Are you accessing tables through a network or in the same
workstation the application runs ?
I've never used the Append method, just the Insert and I've
never got any error like the ones you're getting. Have you
haver used the Insert method ? Why don't you try it?

Pay attention the first line after the call to the Append me-
thod didn't rise any error, so there is nothing wrong with
the FieldByName method, I've being using it in all my
applications with no problem, no matter the OS the workstation
is running. If you refer to the Help file, there is an advice
about using the FieldByName method to have access to
values using the As... properties when the record has
null values.

Jayme.


"Evandro Dugnani" <evandro.dugnani (AT) ablevision (DOT) com> escreveu na mensagem
news:41484dfc (AT) newsgroups (DOT) borland.com...
Quote:
Hi everybody,

Did anybody have problems using TTable on an aplication under Windows
XP
Professional?
I have an aplication that works fine on Windows 2000 Professional (my
SO), but when a client executes it under WinXP an exception occurs.
The code is like the following:

Table1->Active = false;
Table1->TableName = "Teste";
Table1->TableType = ttDBase;

// Creating the table
Table1->FieldDefs->Add("PROCESSADO", ftBoolean, 0, true);
Table1->FieldDefs->Add("NUM_SELECAO", ftInteger, 0, true);
Table1->FieldDefs->Add("EDITADA", ftBoolean, 0, true);
Table1->FieldDefs->Add("AREA_COBERTA", ftFloat, 0, true);
Table1->FieldDefs->Add("AREA_ANALISADA", ftInteger, 0, true);
Table1->FieldDefs->Add("RESOLUCAO", ftInteger, 0, true);
Table1->FieldDefs->Add("ANALISE", ftString, 30, true);
Table1->FieldDefs->Add("DPM", ftInteger, 0, true);
Table1->FieldDefs->Add("MASCARA", ftGraphic, 0, true); file://ftGraphic
Table1->CreateTable();

//... other not related code

// Saving data
Table1->Active = true;
Table1->Append();
Table1->FieldByName("PROCESSADO")->AsBoolean = false;
Table1->FieldByName("NUM_SELECAO")->AsInteger = 1; // *** !!! AN
EXCEPTION
OCCURS HERE !!! ***
Table1->FieldByName("EDITADA")->AsBoolean = true;
Table1->FieldByName("AREA_COBERTA")->AsFloat = 0.0; // if I comment the
line above that causes the exception, then the exception occurs here!!!
//... other fields filling

Table1->Post();
Table1->Active = false;

Any tips??

Thanks in advance,

Evandro Dugnani





Back to top
Evandro Dugnani
Guest





PostPosted: Wed Sep 15, 2004 6:44 pm    Post subject: Re: Error on Windows XP Professional Reply with quote

Stig,

Quote:
What I would use to write to one specific field would be "FieldValues":
I'll test this way (I sent the aplication to my client), but I think I

would have the exception under any Windows (98 / ME / 2000 / XP etc...) if
FieldValues would be the error.
But the same aplication works in Win 2000, for example... more than
that: I've installed Win XP in other machine, and the same program doesn't
generate the exception!!! But I've already had 2 clients (under XP) with
this problem using my program....
I don't understand anything else.... :-P

Evandro Dugnani




Back to top
Evandro Dugnani
Guest





PostPosted: Wed Sep 15, 2004 6:50 pm    Post subject: Re: Error on Windows XP Professional Reply with quote

Correcting: "I would have the exception under any Windows (98 / ME / 2000 /
XP etc...) if FieldByName would be the error"


Back to top
Evandro Dugnani
Guest





PostPosted: Wed Sep 15, 2004 6:59 pm    Post subject: Re: Error on Windows XP Professional Reply with quote

Hi Jayme,

Quote:
Are you accessing tables through a network or in the same
workstation the application runs ?
So... tables are in the same workstation the application runs... and

I've installed a Windows XP Professional in other machine and everything
worked fine!! But I've already had 2 clients with this problem under WinXP!
I'm going to be crazy!! Razz
I'll try using the Insert method instead of Append method.
I'll post any news... Smile
Thanks for your help.

Evandro Dugnani



Back to top
Stig Ove H
Guest





PostPosted: Wed Sep 15, 2004 9:56 pm    Post subject: Re: Error on Windows XP Professional Reply with quote

Tried your code (copy+paste) into a new app. It just ran like dang! No
problems what so ever...
Sorry I couldn't help
Good luck though ;)


Back to top
Stig Ove H
Guest





PostPosted: Wed Sep 15, 2004 10:29 pm    Post subject: Re: Error on Windows XP Professional Reply with quote

AHH! By the way, I'm Running Win XP Pro 2002 W/SP1

*Me sucker* ; D


Back to top
Evandro Dugnani
Guest





PostPosted: Mon Sep 20, 2004 7:43 pm    Post subject: Re: Error on Windows XP Professional Reply with quote

Finally I solved the problem!!! But I couldn't find a concrete
explanation about the error. That's the following: my program uses DBASE
tables like. Well, in the client machine where the error occurs (it's Win XP
Professional, but after discover the error I also replied the error in my
Win 2000 machine) there is another software (from other supplier) that in
its installation process changes a key in Windows Registry under
HKEY_LOCAL_MACHINESOFTWAREBorlandDatabase
EngineSettingsDRIVERSDBASETABLE CREATE: the key is "LEVEL". When my
application installs itself in the machine (I use the Inno Setup to do
that), this key is created with a value of "7" (I think it's the default,
isn't it?); when the other application installs itself, it put this value
with "3". So, in that point of my application
(Table1->FieldByName("NUM_SELECAO")->AsInteger = 1Wink, the exception occurs!
If I restore the LEVEL value to "7", everything works fine.
My question is: anybody knows where I can find what this LEVEL key is? I
couldn't find the answer in bde32.hlp
Thanks in advance.

Evandro Dugnani


Back to top
Don Locke
Guest





PostPosted: Mon Sep 20, 2004 9:36 pm    Post subject: Re: Error on Windows XP Professional Reply with quote

Look in the BDE Administrator. I found this in the help file:

LEVEL Type of table format used to create dBASE temporary tables. Can
be 7 for dBASE 7.0 table format, 5 for dBASE 5.0 table format, 4
for dBASE 4.0 table format, or 3 for dBASE III and dBASE III
PLUS table formats. Use 25 for FoxPro. Default: 7

Note: When accessing dBASE level 7 tables, the driver level must
be set to 7.

Back to top
Evandro Dugnani
Guest





PostPosted: Tue Sep 21, 2004 12:10 pm    Post subject: Re: Error on Windows XP Professional Reply with quote

Thanks Don. That's it. :-)

Evandro Dugnani


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.