DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Wayne Guest

    ODBC/ASP/Server connection


    I'm a newbie and am having problems writing the script to connect to our SQL
    Server using ASP. I know its possible but I can't do it. Could there be
    complications with ODBC? Any examples would be appreciated.
    Thanks

  2. #2
    kendel Guest

    Re: ODBC/ASP/Server connection


    "Wayne" <writter@marketingproducts.com> wrote:
    >
    >I'm a newbie and am having problems writing the script to connect to our

    SQL
    >Server using ASP. I know its possible but I can't do it. Could there be
    >complications with ODBC? Any examples would be appreciated.
    >Thanks


    Take a look at my code:

    var SQLString;
    var rs;
    var SQLConn;

    SQLConn = Server.createobject("ADODB.Connection");
    SQLConn.open(Application("WebDSN"));

    rs = Server.CreateObject("ADODB.RecordSet");
    rs.CursorType=1;
    rs.activeConnection=SQLConn;

    SQLString = "Select * from TableName";

    rs.source = SQLString;
    rs.open();

    hope this will help...


  3. #3
    Wayne Guest

    Re: ODBC/ASP/Server connection


    "kendel" <datsg_2000@yahoo.com> wrote:
    >
    >"Wayne" <writter@marketingproducts.com> wrote:
    >>
    >>I'm a newbie and am having problems writing the script to connect to our

    >SQL
    >>Server using ASP. I know its possible but I can't do it. Could there

    be
    >>complications with ODBC? Any examples would be appreciated.
    >>Thanks

    >
    >Take a look at my code:
    >
    >var SQLString;
    >var rs;
    >var SQLConn;
    >
    >SQLConn = Server.createobject("ADODB.Connection");
    >SQLConn.open(Application("WebDSN"));
    >
    >rs = Server.CreateObject("ADODB.RecordSet");
    >rs.CursorType=1;
    >rs.activeConnection=SQLConn;
    >
    >SQLString = "Select * from TableName";
    >
    >rs.source = SQLString;
    >rs.open();
    >
    >hope this will help...
    >

    Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links