473,796 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

server.createob ject 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.CreateOb ject("CQSBackOf fice.BOLHandler ");
CQSBackOffice.B OLHandlerClass bb = (CQSBackOffice. BOLHandlerClass ) System.
Runtime.Interop Services.Marsha l.CreateWrapper OfType(o,
typeof(CQSBackO ffice.BOLHandle rClass));
//o.Connect("","" ,"");
bb.UserName = "sup";
bb.Password = "";
bb.Connect("CWT ","data",@"\\se rvername\Client Data\");

string sqq = bb.ReasonText;
Type tServerType = Type.GetTypeFro mProgID("CQSBac kOffice.BOLHand ler");
CQSBackOffice.B OLHandlerClass b = (CQSBackOffice. BOLHandlerClass )
Activator.Creat eInstance(tServ erType);

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

string s = b.ReasonText;

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

Type tServerType2 = Type.GetTypeFro mProgID("CQSBac kOffice.BOLHand ler");
CQSBackOffice.B OLHandlerClass b2 = (CQSBackOffice. BOLHandlerClass )Server.
CreateObject(tS erverType2);
b2.UserName = "sup";
b2.Password = "";
b2.Connect("CWT ","data",@"\\se rvername\Client Data\");

string s2 = b2.ReasonText;

// // Create a remote WMSServer object from a System.Type object and a
// // System.Activato r object.
Type tServerType3 = Type.GetTypeFro mProgID("CQSBac kOffice.BOLHand ler");
CQSBackOffice.B OLHandlerClass b3 = (CQSBackOffice. BOLHandlerClass )
Activator.Creat eInstance(tServ erType3);
b3.UserName = "sup";
b3.Password = "";
b3.Connect("CWT ","data",@"\\se rvername\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.Createob ject in VB.NET the code works

So basically,

//pseudo Code begin (VB.NET)

Object x = Server.CreateOb ject("Object.Cl ass")

x.UserName = "sup";
x.Password = "";
x.Connect("CWT" ,"data",@"\\ser vername\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.c om
http://www.dotnetmonster.com/Uwe/For...p-net/200611/1

Nov 14 '06 #1
0 1835

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

Similar topics

8
3952
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 and if so, how can I send emails from ASP page... Many thanks in advance
1
6592
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 server don´t response right. xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
12
2073
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 have written the following three class: 1.icoCORE_test 2.icoMINDB_test
28
4847
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 functions itself.
4
10676
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 in IIS? We use Javascript for our ASP coding, using a mixture of Server.CreateObject() and new ActiveXObject(). The web server hangs occasionally (once every 2-3 months) and we were wondering if this might be the culprit... Thanks!
14
7043
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 sql server resides on is not reachable. The error is different depending on the connection string that I use. If I use the following connection string: "server=192.1.1.1; Initial Catalog=master; uid=The_User; password=The_Password; Connect...
7
6210
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 Body_Onload = obj.cTestDelete
0
2639
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 saved to an .xml document and posted to another server though an .asp file. The problem is the other server is either not receiving the data (it says it exports without an problems on our end) or it is not receiving the data correctly. The only...
3
7054
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 the object creation happens with Server.CreateObject, I would like to create 'visible scenarios' that i create with code to show people that '"look. here's the difference". Is it possible ? I will create a page with 2 calls, 1 with...
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.