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.

 
JebAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwilson032697Commented:
Listening
0
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 !!
0
EpsylonCommented:
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.....
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

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 ??
0
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")
  DESDB1.Execute("aaa")
  Response.write("Search is executed")
  DESDB1.GetData 0,0,MyStr
  Response.write(MyStr)
%>

0
EpsylonCommented:
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'.

0
kubeerjaCommented:
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.
0
EpsylonCommented:
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?
0
nrobinCommented:
Jeb, first see if you can instantiate the object using Delphi:

var ov: olevariant;

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

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.

Nick.
0
nrobinCommented:
Jeb,

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

Nick.
0
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 !!

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.