ODBC/ASP/Server connection


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: ODBC/ASP/Server connection

  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.


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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center