DTS and web page grab

  • Hi all,

    Is it possible to use DTS to execute a remote web page that returns a recordset then dump that into a table...? I was initially using the PHP fopen() command on the URL but now the site has moved over to ASP and msSQL so looking for a way to simulate that behaviour.

    Thanks for any help

    Rolf

  • This was removed by the editor as SPAM

  • Hi Rolf,

    after reading what php fopen() does, I think the FileSystemObject might be equivalent to it.

    I'm not sure if this will work on a remote site, but you can use an ActiveX Script Task with this script. I've found this in MSDN

    '**********************************************************************

    ' Visual Basic ActiveX Script

    '************************************************************************

    Function Main()

    Const ForReading = 1, ForWriting = 2, ForAppending = 8

    Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0

    Dim fso, f, ts

    Set fso = CreateObject("Scripting.FileSystemObject")

    fso.CreateTextFile "test1.txt" ' Create a file.

    Set f = fso.GetFile("test1.txt")

    Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)

    ts.Write "Hello World"

    ts.Close

    Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)

    TextStreamTest = ts.ReadLine

    ts.Close

    End Function

    Another way might be using the ShellExecute API function

    void CLaunchIEDlg::OnOK()

    {

    CWnd::UpdateData(TRUE);

    //LPCTSTR lpszPath = "C:\\PROGRAMME\\PLUS!\\MICROSOFT INTERNET\\Iexplore.exe ";

    LPCTSTR lpszPath = "Iexplore";

    LPCTSTR lpszSite = m_Site;

    ShellExecute(NULL, "open", lpszPath, lpszSite, NULL, SW_SHOWNORMAL );

    EndDialog(1);

    return;

    }

    Sorry, only in C++. but ShellExecute is well documented and works also with VB.

    HTH

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Hi again Rolf,

    BTW have you tried working with php on mssql server? I think php4 supports SQL7 and SQL2k

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • thanks for the replies...looking into an ActiveX script now.

    Rolf

  • Hi Rolf,

    I'm playing around at home with PHP and MySQL (mainly because PHP ISP's are much more cheaper than ASP ISP's) . I have seen in PHP4 several functions for MSSQL Server. Can't you use one of these functions?

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply