Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using a COM to return data

3 views
Skip to first unread message

Debbie

unread,
Mar 14, 2005, 11:13:09 AM3/14/05
to
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

unread,
Mar 14, 2005, 11:19:55 AM3/14/05
to
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


"Debbie" <brit...@hotmail.com> wrote in message
news:vvidnePl3qe...@adelphia.com...

Debbie

unread,
Mar 14, 2005, 12:06:45 PM3/14/05
to
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

"Craig Berntson" <iamc...@iamcraigberntson.com> wrote in message
news:%237X4pGL...@TK2MSFTNGP12.phx.gbl...

Juan Alonso

unread,
Mar 14, 2005, 1:35:31 PM3/14/05
to
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.

"Debbie" <brit...@hotmail.com> wrote in message

news:LcqdnXJ8Dac...@adelphia.com...

DJ Hunt

unread,
Mar 14, 2005, 1:38:35 PM3/14/05
to
"Debbie" <brit...@hotmail.com> wrote in message
news:LcqdnXJ8Dac...@adelphia.com...

> 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....@DJ-Hunt.com


Juan Alonso

unread,
Mar 14, 2005, 1:47:13 PM3/14/05
to
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.

"Juan Alonso" <jac...@hotmail.com> wrote in message
news:eyo8HXM...@TK2MSFTNGP15.phx.gbl...


> 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.


>
>
> "Debbie" <brit...@hotmail.com> wrote in message

> news:LcqdnXJ8Dac...@adelphia.com...

Juan Alonso

unread,
Mar 14, 2005, 1:42:58 PM3/14/05
to
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.


"Debbie" <brit...@hotmail.com> wrote in message

news:LcqdnXJ8Dac...@adelphia.com...

Claude Fox

unread,
Mar 15, 2005, 6:33:05 AM3/15/05
to
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...

"Debbie" <brit...@hotmail.com> wrote in message
news:vvidnePl3qe...@adelphia.com...

0 new messages