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 

Access Violation only on Wndows Server 2000 and 2003

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Deployment
View previous topic :: View next topic  
Author Message
David Sovinski
Guest





PostPosted: Tue Jan 09, 2007 5:51 am    Post subject: Access Violation only on Wndows Server 2000 and 2003 Reply with quote



I wrote an application in Borland Developer Studio 2006 Professional.

I did all my testing on Win2kPro and XP Pro Desktops. My application works
just fine.

However when put it on a Windows 2000 Server or Windows 2003 Server with or
without Terminal Services I get an
"Access violation at address 0156ACDC. Write of address 0156ACDC." when
trying to open the file

Sample code follows. It always breaks when trying to use the DLL's OpenFile
function. (Where the --> is in the code)

What really frosts me is that I can use the same DLL called from within
EXCEL using Visual Basic or using Microsoft generated .NET application and
it works fine. Just not my program using the same DLL.

I've had two other companies look at the Server(s) configuration. They don't
know each other and are 1200 miles apart.
It won't work either placed. DLL is registered properly or EXCEL and the
..NET apps would break.

We've opened every permission we can think of at 3 companies trying to get
it to work.

Question: What would make it work on XP Pro and Win2k and not the Servers?

procedure TForm1.Button1Click(Sender: TObject);
var
sPamData: string;
PamItem: IPamClassItem;
wsFindItem,
wsItemReturn,
wsFileName,
wsCloseFile,
wsOpenFile: WideString;
begin
// Works with manufacturing company only "mfg.ctl" ex "c:\sam\mfg"
sPamData := 'c:\sam\mfg';
wsFileName := sPamData;
PamItem := Copamclassitem_.Create;
--> wsOpenFile := PamItem.OpenFile(wsFileName);
wsFindItem := '903010';
wsItemReturn := PamItem.ReadRecord(wsFindItem);
wsCloseFile := PamItem.CloseFile;
PamItem := nil;
ShowMessage('ReadRecord: '+wsItemReturn);
end;
Back to top
David Sovinski
Guest





PostPosted: Tue Jan 09, 2007 9:17 pm    Post subject: Re: Access Violation only on Wndows Server 2000 and 2003 Reply with quote



Rereading this after a good nights sleep, I see a few things that can be
made more clear.

1) "trying to open the file" The file being refered to is a COBAL table that
is attempting to be opened through the use of a DLL, by my program, that
provides access to the data in that table.

2) The application works just fine means that I am able to use all the
functionality of the DLL to Open, Close, and manipulate data within that
table via the DLLs from Win2k Pro and XP Pro desktops.

3) My program starts fine from the Server(s), it's just when I push the
button to use the DLL functionality that produces the Access Violation.

4) The Visual Basic program in Excel and the .NET programs work fine from
the servers accessing the same DLL and the same table. It seems that if the
DLLs are accessed from a Microsoft program they work, from a Borland program
they don't.

5) The servers that the program has been used on are 1200 miles apart
installed and maintained by two sets of people. They are two completely
separated installations.


So the question remains
Question: What would make it work on XP Pro and Win2k and not the Servers?
How can I get it to work on the server.

Thanks!


"David Sovinski" <ds (AT) aslandata (DOT) com> wrote in message
news:45a2d8db$1 (AT) newsgroups (DOT) borland.com...
Quote:
I wrote an application in Borland Developer Studio 2006 Professional.

I did all my testing on Win2kPro and XP Pro Desktops. My application works
just fine.

However when put it on a Windows 2000 Server or Windows 2003 Server with
or
without Terminal Services I get an
"Access violation at address 0156ACDC. Write of address 0156ACDC." when
trying to open the file

Sample code follows. It always breaks when trying to use the DLL's
OpenFile
function. (Where the --> is in the code)

What really frosts me is that I can use the same DLL called from within
EXCEL using Visual Basic or using Microsoft generated .NET application and
it works fine. Just not my program using the same DLL.

I've had two other companies look at the Server(s) configuration. They
don't
know each other and are 1200 miles apart.
It won't work either placed. DLL is registered properly or EXCEL and the
.NET apps would break.

We've opened every permission we can think of at 3 companies trying to get
it to work.

Question: What would make it work on XP Pro and Win2k and not the Servers?

procedure TForm1.Button1Click(Sender: TObject);
var
sPamData: string;
PamItem: IPamClassItem;
wsFindItem,
wsItemReturn,
wsFileName,
wsCloseFile,
wsOpenFile: WideString;
begin
// Works with manufacturing company only "mfg.ctl" ex "c:\sam\mfg"
sPamData := 'c:\sam\mfg';
wsFileName := sPamData;
PamItem := Copamclassitem_.Create;
--> wsOpenFile := PamItem.OpenFile(wsFileName);
wsFindItem := '903010';
wsItemReturn := PamItem.ReadRecord(wsFindItem);
wsCloseFile := PamItem.CloseFile;
PamItem := nil;
ShowMessage('ReadRecord: '+wsItemReturn);
end;

Back to top
Bill Todd
Guest





PostPosted: Tue Jan 09, 2007 9:53 pm    Post subject: Re: Access Violation only on Wndows Server 2000 and 2003 Reply with quote



David Sovinski wrote:

Quote:
1) "trying to open the file" The file being refered to is a COBAL
table

Do you mean COBOL? If not, what is COBAL?

--
Bill Todd (TeamB)
Back to top
Brion L. Webster
Guest





PostPosted: Tue Jan 09, 2007 10:38 pm    Post subject: Re: Access Violation only on Wndows Server 2000 and 2003 Reply with quote

Bill Todd wrote:

Quote:
David Sovinski wrote:

1) "trying to open the file" The file being refered to is a COBAL
table

Do you mean COBOL? If not, what is COBAL?

Isn't there a need to manually call a coinitialize_ex "thingamabob"
occasionally? Not sure if I'm on the right path here, but something about
this "works in VB but not in Delphi" reminds me of similar issues when
WebSnap/ADO was having problems.

--
-Brion

There's no such thing as 'one, true way;'
- Mercedes Lackey
Back to top
David Sovinski
Guest





PostPosted: Thu Jan 11, 2007 10:28 pm    Post subject: Re: Access Violation only on Wndows Server 2000 and 2003 Reply with quote

oooops my fault. It is COBOL. Maybe the "O" key is too near the "A" key? :)

Dave

"Bill Todd" <no (AT) no (DOT) com> wrote in message
news:45a3ba6b$1 (AT) newsgroups (DOT) borland.com...
Quote:
David Sovinski wrote:

1) "trying to open the file" The file being refered to is a COBAL
table

Do you mean COBOL? If not, what is COBAL?

--
Bill Todd (TeamB)
Back to top
Bill Todd
Guest





PostPosted: Thu Jan 11, 2007 10:47 pm    Post subject: Re: Access Violation only on Wndows Server 2000 and 2003 Reply with quote

Try posting your question in the delphi.language.win32 group. Someone
there may be able to help.

--
Bill Todd (TeamB)
Back to top
David Sovinski
Guest





PostPosted: Fri Jan 12, 2007 10:14 pm    Post subject: Re: Access Violation only on Wndows Server 2000 and 2003 (Th Reply with quote

The problem is solved!

There is a new feature in Service Pack 2 called DEP (Data Execution
Prevention).

Part of it may be found in Control
Panel->System->Advanced->Performance->Settings->Data Execution Prevention->
(Select) Turn on DEP for essential Windows programs and services only. (And
then reboot your computer)

That fixed SOME of my program problems. DEP actually has 4 settings only 2
of which are shown on the dialog tab described above.
http://support.microsoft.com/kb/875352 has a complete description of the 4
options for DEP and how to set them (They make you view the link in IE or
not all the data shows)

I had to set my boot.ini file so that
/NoExecute=AlwaysOff (Then reboot)and not the
/NoExecute=OptIn or =OptOut that the radio buttons provideNow everything
works fine!

David Sovinski



"David Sovinski" <ds (AT) aslandata (DOT) com> wrote in message
news:45a2d8db$1 (AT) newsgroups (DOT) borland.com...
Quote:
I wrote an application in Borland Developer Studio 2006 Professional.

I did all my testing on Win2kPro and XP Pro Desktops. My application works
just fine.

However when put it on a Windows 2000 Server or Windows 2003 Server with
or
without Terminal Services I get an
"Access violation at address 0156ACDC. Write of address 0156ACDC." when
trying to open the file

Sample code follows. It always breaks when trying to use the DLL's
OpenFile
function. (Where the --> is in the code)

What really frosts me is that I can use the same DLL called from within
EXCEL using Visual Basic or using Microsoft generated .NET application and
it works fine. Just not my program using the same DLL.

I've had two other companies look at the Server(s) configuration. They
don't
know each other and are 1200 miles apart.
It won't work either placed. DLL is registered properly or EXCEL and the
.NET apps would break.

We've opened every permission we can think of at 3 companies trying to get
it to work.

Question: What would make it work on XP Pro and Win2k and not the Servers?

procedure TForm1.Button1Click(Sender: TObject);
var
sPamData: string;
PamItem: IPamClassItem;
wsFindItem,
wsItemReturn,
wsFileName,
wsCloseFile,
wsOpenFile: WideString;
begin
// Works with manufacturing company only "mfg.ctl" ex "c:\sam\mfg"
sPamData := 'c:\sam\mfg';
wsFileName := sPamData;
PamItem := Copamclassitem_.Create;
--> wsOpenFile := PamItem.OpenFile(wsFileName);
wsFindItem := '903010';
wsItemReturn := PamItem.ReadRecord(wsFindItem);
wsCloseFile := PamItem.CloseFile;
PamItem := nil;
ShowMessage('ReadRecord: '+wsItemReturn);
end;

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Deployment 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.