Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    212

    Unanswered: using sql in activeX script

    Is it possible to use select statements in Activex script?

  2. #2
    Join Date
    Aug 2003
    Location
    Andover, MA
    Posts
    256
    Yes. Here's the fastest way, but there are better ways...

    Set mConn = CreateObject("ADODB.Connection")
    mConn.Open "Provider=SQLOLEDB.1;Data Source=[your server name];Initial Catalog=[your database name]", [your username], [your password]

    Set mRecordset=mConn.Execute("SELECT * FROM [your table]")

    Do While Not(mRecordset.EOF)
    [code to process or display recordset data]
    Loop


    Consult the MSDN documentation fr ADO Connection and Recordset objects for more info. Also look up the Command object, which is used with stored procedures and allows you to deal with parameters more effectively.
    -bpd

  3. #3
    Join Date
    Oct 2001
    Location
    England
    Posts
    426

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •