473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

server.createobject differences between c# and vb.net

hi all,

Running VS.2003 , framework 1.1.

I have a COM object written in Delphi which im trying to call through ASP.NET.
The COM object connects to a folder on another machine and opens a connection
to a foxpro database in that folder. I have a problem with even accessing
that path through SYSTEM.IO.File.EXists and Peter Bromberg suggested
impersonation via LOGONUSER. I have implemented LOGONUSER and now I can
access the file via SYSTEM.IO.File but the problem now is that the COM Object
cannot access that path. I thought it might be impersonation and have left
that implemented but have tried

1. setting <impersonate = "true" in web config
2. setting user name and password to a domain user in machine.config.
I tried creating the object in C# through the following methods

//CODE begin

object o = new object();

o = Server.CreateObject("CQSBackOffice.BOLHandler");
CQSBackOffice.BOLHandlerClass bb = (CQSBackOffice.BOLHandlerClass) System.
Runtime.InteropServices.Marshal.CreateWrapperOfTyp e(o,
typeof(CQSBackOffice.BOLHandlerClass));
//o.Connect("","","");
bb.UserName = "sup";
bb.Password = "";
bb.Connect("CWT","data",@"\\servername\Client Data\");

string sqq = bb.ReasonText;
Type tServerType = Type.GetTypeFromProgID("CQSBackOffice.BOLHandler") ;
CQSBackOffice.BOLHandlerClass b = (CQSBackOffice.BOLHandlerClass)
Activator.CreateInstance(tServerType);

b.UserName = "sup";
b.Password = "";
b.Connect("CWT","data",@"\\servername\Client Data\");

string s = b.ReasonText;

// Create a remote WMSServer object from a System.Type object and
// the CreateObject method.

Type tServerType2 = Type.GetTypeFromProgID("CQSBackOffice.BOLHandler") ;
CQSBackOffice.BOLHandlerClass b2 = (CQSBackOffice.BOLHandlerClass)Server.
CreateObject(tServerType2);
b2.UserName = "sup";
b2.Password = "";
b2.Connect("CWT","data",@"\\servername\Client Data\");

string s2 = b2.ReasonText;

// // Create a remote WMSServer object from a System.Type object and a
// // System.Activator object.
Type tServerType3 = Type.GetTypeFromProgID("CQSBackOffice.BOLHandler") ;
CQSBackOffice.BOLHandlerClass b3 = (CQSBackOffice.BOLHandlerClass)
Activator.CreateInstance(tServerType3);
b3.UserName = "sup";
b3.Password = "";
b3.Connect("CWT","data",@"\\servername\Client Data\");

string s3 = b3.ReasonText;

//CODE End

The .Reason text always returns "access denied" or file related errors.

Now for the killer..

When running Server.Createobject in VB.NET the code works

So basically,

//pseudo Code begin (VB.NET)

Object x = Server.CreateObject("Object.Class")

x.UserName = "sup";
x.Password = "";
x.Connect("CWT","data",@"\\servername\Client Data\");

//Code end

The code above works...

I'm looking kinda stupid now because I can't get this to work in C#...

So what is the problem here? Is it that VB.NET does the Wrapper and Binding
in such a way that results in some level of impersonation being passed
through in the Wrapper?

Or is this a VS.2003 bug?

Thanks for any assistance,

Q

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200611/1

Nov 14 '06 #1
0 1811

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Boris | last post by:
Could someone please tell me if I can use CDONTS in W 2003 Server environment to send emails the same way it is used in W2K Server. I have heard that CDONTS is no longer available in W 2003 Server...
1
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the...
12
by: karen | last post by:
Hi all : this is going to be a long post. So i apologize in advance :) i am converting a java program in VB right now. I am a java programmer by trade. so i am no expert in this department. I...
28
by: Gil | last post by:
can i have a client pc trigger access.exe to open on the server side pc? i want to have the server run special functions and return the output to the clients without having the clients run the...
4
by: Andrew Hilton | last post by:
When you create an object in classic asp code, should you always use Server.CreateObject("ProgID")? Are there implications with stability (ie memory leaks) if you create COM objects in other ways...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
7
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function Body_Onload() ' create the object Set obj = Server.CreateObject("UploadImage.cTest") ' use method of the object...
0
by: kwilliams1130 | last post by:
I am having a problem with data that is being posted to another server. The problem is I collect the data from our database through an .cfm file (and all data is correct), which then the data is...
3
by: Sagar | last post by:
I am working on a project where Server.CreateObject is replaced with CreateObject all over the project. Though I know that this will improve performance in terms of Memory overlhead because of how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.