Discussion:
Using a COM to return data
(too old to reply)
Debbie
2005-03-14 16:13:09 UTC
Permalink
I have a simple COM that works with web pages that checks account
information, returns prices for jobs and does other basic stuff. However, I
now need the COM to be able to return data to an ASP page for tracking job
status etc and I don't have a clue how best to do this. The only thing I
can think of is to have the COM use an SQL to extract the information
required, then copy it out to a throwaway table and pass the table name as a
reference back to the ASP page so that web designer can code his/her page to
pull everything out of that temp table and delete the table themselves when
they're done. I'm sure this isn't the way to do it, but it's the only thing
I can think of!

Could anyone tell me how I should be handling this problem?

Many thanks - Debbie
Craig Berntson
2005-03-14 16:19:55 UTC
Permalink
You can return the data as an ADO record set or XML.
--
Craig Berntson
MCSD, Visual FoxPro MVP
www.craigberntson.com
Salt Lake City Fox User Group
www.slcfox.org
www.foxcentral.net
Post by Debbie
I have a simple COM that works with web pages that checks account
information, returns prices for jobs and does other basic stuff. However,
I now need the COM to be able to return data to an ASP page for tracking
job status etc and I don't have a clue how best to do this. The only thing
I can think of is to have the COM use an SQL to extract the information
required, then copy it out to a throwaway table and pass the table name as
a reference back to the ASP page so that web designer can code his/her page
to pull everything out of that temp table and delete the table themselves
when they're done. I'm sure this isn't the way to do it, but it's the only
thing I can think of!
Could anyone tell me how I should be handling this problem?
Many thanks - Debbie
Debbie
2005-03-14 17:06:45 UTC
Permalink
Thanks - but how exactly do I do that?!

I have seen several articles on the internet where the web designer is using
code to create connection strings etc to access databases and tables, but I
am not the one designing the ASP web pages and I wanted the web designer to
call a method in my COM that would pull the necessary data out of various
tables and pass the results back to the ASP page. I guess my main problem
is I don't have any understanding of how the whole process works - I was
hoping that the web designer could just create a instance of my COM, set its
DataPath property and then call a method to gather the data like below:

oCOM = Server.CreateObject("MyCOM.MyCOM")
oCOM.DataPath = "c:\trackingmodule\data\"
oTrackingData = oCOM.GetData()

When you say "You can return the data as an ADO record set or XML", do you
mean the web designer would include the relevant code in the ASP page, or do
you mean I would actually write FoxPro code in my COM to do that? If its
the latter, (1) how do I do that, and (2) is the data returned as a cursor
or a table, and (3) who/how is the cursor or table closed.

Sorry to sound so stupid!

Debbie
Post by Craig Berntson
You can return the data as an ADO record set or XML.
--
Craig Berntson
MCSD, Visual FoxPro MVP
www.craigberntson.com
Salt Lake City Fox User Group
www.slcfox.org
www.foxcentral.net
Post by Debbie
I have a simple COM that works with web pages that checks account
information, returns prices for jobs and does other basic stuff. However,
I now need the COM to be able to return data to an ASP page for tracking
job status etc and I don't have a clue how best to do this. The only
thing I can think of is to have the COM use an SQL to extract the
information required, then copy it out to a throwaway table and pass the
table name as a reference back to the ASP page so that web designer can
code his/her page to pull everything out of that temp table and delete the
table themselves when they're done. I'm sure this isn't the way to do it,
but it's the only thing I can think of!
Could anyone tell me how I should be handling this problem?
Many thanks - Debbie
Juan Alonso
2005-03-14 18:35:31 UTC
Permalink
Hello Debbie.

I think this might help you out.

If you are still having problems I can send you more pages with "HOW TO"
articles.

Thanks and I hope it helps.

John.
Post by Debbie
Thanks - but how exactly do I do that?!
I have seen several articles on the internet where the web designer is
using code to create connection strings etc to access databases and
tables, but I am not the one designing the ASP web pages and I wanted the
web designer to call a method in my COM that would pull the necessary data
out of various tables and pass the results back to the ASP page. I guess
my main problem is I don't have any understanding of how the whole process
works - I was hoping that the web designer could just create a instance of
my COM, set its DataPath property and then call a method to gather the
oCOM = Server.CreateObject("MyCOM.MyCOM")
oCOM.DataPath = "c:\trackingmodule\data\"
oTrackingData = oCOM.GetData()
When you say "You can return the data as an ADO record set or XML", do you
mean the web designer would include the relevant code in the ASP page, or
do you mean I would actually write FoxPro code in my COM to do that? If
its the latter, (1) how do I do that, and (2) is the data returned as a
cursor or a table, and (3) who/how is the cursor or table closed.
Sorry to sound so stupid!
Debbie
Post by Craig Berntson
You can return the data as an ADO record set or XML.
--
Craig Berntson
MCSD, Visual FoxPro MVP
www.craigberntson.com
Salt Lake City Fox User Group
www.slcfox.org
www.foxcentral.net
Post by Debbie
I have a simple COM that works with web pages that checks account
information, returns prices for jobs and does other basic stuff.
However, I now need the COM to be able to return data to an ASP page for
tracking job status etc and I don't have a clue how best to do this. The
only thing I can think of is to have the COM use an SQL to extract the
information required, then copy it out to a throwaway table and pass the
table name as a reference back to the ASP page so that web designer can
code his/her page to pull everything out of that temp table and delete
the table themselves when they're done. I'm sure this isn't the way to
do it, but it's the only thing I can think of!
Could anyone tell me how I should be handling this problem?
Many thanks - Debbie
DJ Hunt
2005-03-14 18:38:35 UTC
Permalink
Post by Debbie
Thanks - but how exactly do I do that?!
Might this help:

loConn = createobject([ADODB.Connection])
if vartype(loConn) = [O]
loConn.ConnectionString = [Driver=SQL
Server;Server=MySQLServer;Database=MyDatabase;UID=User;PWD=Password]
loConn.Open()
endif
--
The Hacker's Guide to GoldMine 6.7 - http://www.dj-hunt.com/hg_toc3.htm

One-on-One GoldMine Technical Support ( Fee Based Service ) -
http://www.dj-hunt.com/gm_tech_support.htm

DJ Hunt

Phone: (978)342-3333
Email: ***@DJ-Hunt.com
Juan Alonso
2005-03-14 18:42:58 UTC
Permalink
Hello Debbie.

I think this might help you out.

If you are still having problems I can send you more pages with "HOW TO"
articles.

Thanks and I hope it helps.
http://support.microsoft.com/kb/q152972/

John.
Post by Debbie
Thanks - but how exactly do I do that?!
I have seen several articles on the internet where the web designer is
using code to create connection strings etc to access databases and
tables, but I am not the one designing the ASP web pages and I wanted the
web designer to call a method in my COM that would pull the necessary data
out of various tables and pass the results back to the ASP page. I guess
my main problem is I don't have any understanding of how the whole process
works - I was hoping that the web designer could just create a instance of
my COM, set its DataPath property and then call a method to gather the
oCOM = Server.CreateObject("MyCOM.MyCOM")
oCOM.DataPath = "c:\trackingmodule\data\"
oTrackingData = oCOM.GetData()
When you say "You can return the data as an ADO record set or XML", do you
mean the web designer would include the relevant code in the ASP page, or
do you mean I would actually write FoxPro code in my COM to do that? If
its the latter, (1) how do I do that, and (2) is the data returned as a
cursor or a table, and (3) who/how is the cursor or table closed.
Sorry to sound so stupid!
Debbie
Post by Craig Berntson
You can return the data as an ADO record set or XML.
--
Craig Berntson
MCSD, Visual FoxPro MVP
www.craigberntson.com
Salt Lake City Fox User Group
www.slcfox.org
www.foxcentral.net
Post by Debbie
I have a simple COM that works with web pages that checks account
information, returns prices for jobs and does other basic stuff.
However, I now need the COM to be able to return data to an ASP page for
tracking job status etc and I don't have a clue how best to do this. The
only thing I can think of is to have the COM use an SQL to extract the
information required, then copy it out to a throwaway table and pass the
table name as a reference back to the ASP page so that web designer can
code his/her page to pull everything out of that temp table and delete
the table themselves when they're done. I'm sure this isn't the way to
do it, but it's the only thing I can think of!
Could anyone tell me how I should be handling this problem?
Many thanks - Debbie
Juan Alonso
2005-03-14 18:47:13 UTC
Permalink
Sorry.. This is what I wante to send.

http://fox.wikis.com/wc.dll?Wiki~ASPandVFP~VFP

My mistake.. had the wrong site in clipboard...lol

John.
Post by Juan Alonso
Hello Debbie.
I think this might help you out.
If you are still having problems I can send you more pages with "HOW TO"
articles.
Thanks and I hope it helps.
http://support.microsoft.com/kb/q152972/
John.
Post by Debbie
Thanks - but how exactly do I do that?!
I have seen several articles on the internet where the web designer is
using code to create connection strings etc to access databases and
tables, but I am not the one designing the ASP web pages and I wanted the
web designer to call a method in my COM that would pull the necessary
data out of various tables and pass the results back to the ASP page. I
guess my main problem is I don't have any understanding of how the whole
process works - I was hoping that the web designer could just create a
instance of my COM, set its DataPath property and then call a method to
oCOM = Server.CreateObject("MyCOM.MyCOM")
oCOM.DataPath = "c:\trackingmodule\data\"
oTrackingData = oCOM.GetData()
When you say "You can return the data as an ADO record set or XML", do
you mean the web designer would include the relevant code in the ASP
page, or do you mean I would actually write FoxPro code in my COM to do
that? If its the latter, (1) how do I do that, and (2) is the data
returned as a cursor or a table, and (3) who/how is the cursor or table
closed.
Sorry to sound so stupid!
Debbie
Post by Craig Berntson
You can return the data as an ADO record set or XML.
--
Craig Berntson
MCSD, Visual FoxPro MVP
www.craigberntson.com
Salt Lake City Fox User Group
www.slcfox.org
www.foxcentral.net
Post by Debbie
I have a simple COM that works with web pages that checks account
information, returns prices for jobs and does other basic stuff.
However, I now need the COM to be able to return data to an ASP page for
tracking job status etc and I don't have a clue how best to do this.
The only thing I can think of is to have the COM use an SQL to extract
the information required, then copy it out to a throwaway table and pass
the table name as a reference back to the ASP page so that web designer
can code his/her page to pull everything out of that temp table and
delete the table themselves when they're done. I'm sure this isn't the
way to do it, but it's the only thing I can think of!
Could anyone tell me how I should be handling this problem?
Many thanks - Debbie
Claude Fox
2005-03-15 11:33:05 UTC
Permalink
Debbie,
Make sure you've compiled the vfp part to an mtdll woth OLEPUBLIC keyword in
your class and you should be able to interop with ASP or ASp.NET seamlessly
like:
(ASP)
<%
Session.Timeout = 1440
Response.Expires=0
Set oServer = Server.CreateObject("MyTest.server")
Set oServer = oServer.GetDebugObject()
Response.Write(oServer.process())
%>
OR
(ASP.NET)
<% @Page Language="C#" ASPCompat="true" %>
<% @Import Namespace="mytest_dotnetproxy" %>
<%
server x ;
x = new server() ;
try
{
Response.Write(x.process());
}
catch(Exception ex)
{
Response.Write("Caught .NET exception, source: " + ex.Source + "
message: " + ex.Message);
}

%>
This works great and you can pass objects back and forth between the
environments...
Post by Debbie
I have a simple COM that works with web pages that checks account
information, returns prices for jobs and does other basic stuff. However,
I now need the COM to be able to return data to an ASP page for tracking
job status etc and I don't have a clue how best to do this. The only thing
I can think of is to have the COM use an SQL to extract the information
required, then copy it out to a throwaway table and pass the table name as
a reference back to the ASP page so that web designer can code his/her page
to pull everything out of that temp table and delete the table themselves
when they're done. I'm sure this isn't the way to do it, but it's the only
thing I can think of!
Could anyone tell me how I should be handling this problem?
Many thanks - Debbie
Loading...