COM and ASP !!

I'm working on a typelibrary containing and Automation Server for retrieving data from a non standard Database.

I can connect to the remote server and find the Data, But I need Delphi Access to an ASP object or ASP access to the Delphi object.

My type is as so:
TStringArray = array of array of string;

When I've searched I got the data i a TStringArray ( two dim array ).
Now I need a way to make the data visible to ASP !!  some ASP type like the TStringArray.

Who is Participating?
EpsylonConnect With a Mentor Commented:
I think the best you can do is to create an (ActiveX) object that has access to the 2-dim array. This object needs methods and properties so that ASP is able to retrieve data like the dimensions and the data itself.
This way you can use a for-next loop in ASP to get the strings one by one from the object, just like the standard recordset object does.

Before I continue I would like to know if I am on the right track.....
JebAuthor Commented:
If I can use an ASP Recordset from Delphi and put the data into that instead of my TStringArray then is't ok too.   Just need a type that's visible to both Delphi and ASP !!
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

JebAuthor Commented:
Ok !!

I got the Active-X object already( the  Automation server).
I just wanted something like the ASP Recordset Object.

You mean I could make a function like
GetAString(Posx,Posy):String ??

Returning a cell in my two dim array, so that ASP retrieves the contents of the individual Cells via that function.

Is that fast enough ??
JebAuthor Commented:
It works now from Delphi.

I can create an object activeX object and test it from Delphi and it works !!

But ASP says

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object

/test.asp, line 2 ( the line where I create the object )

simpel ASP test
  Set DESDB1 = Server.CreateObject("DESDB.Connection")
  Response.write("DESDB Created")
  DESDB1.Open("Open DESDB Test")
  Response.write("Database is open")
  Response.write("Search is executed")
  DESDB1.GetData 0,0,MyStr

Looks like we are on the same track regarding the 'GetAString' function/method you mention   :o)

I don't think you can return the entire array at once, though I'm not sure about this.

I don't know what you mean with 'something like the recordset object'. To what are you refering here? Note that the recordset object uses other object inside like 'fields'.

why don't create your com object as an ASP componenet and in this case you have access to the ASP objects (Response, request, session , application) from inside your delphi app.
About the error in line 2:

1) is the name of the object correct? It should be <the name of the project>.<name of the CoClass>  (e.g. Project1.MyObject)
2) did you register the object using tregsvr?
Jeb, first see if you can instantiate the object using Delphi:

var ov: olevariant;

  ov := CreateOleObject('DESDB.Connection');

If that works fine, then you may need to look at the type of what is coming back, it needs to be OLE2 compliant - see Delphi notes on this.


Youre safest bet is to either consider a two dim array OleVariant for the structure, or something called SafeArray.

JebAuthor Commented:
Now it works all the way !!

It was my Personal Web server that cached it !!

It works when I make a Delphi testproject !!  and now I'm finished and it works on the webserver on other PC's now.

I made a GetCell(Ypos):widestring
a NextRow and a prevRow and MoteTo(Row)

Now it works just like ADO !!

All Courses

From novice to tech pro — start learning today.