Open Recordset Example ... Please

Results 1 to 2 of 2

Thread: Open Recordset Example ... Please

  1. #1
    Persesus Guest

    Default Open Recordset Example ... Please

    Can anyone give me an example of code that would connect to a SQL server and open a record set based on an SQL, And return a Recordcount ?

  2. #2
    Join Date
    Dec 1969

    Default RE: Open Recordset Example ... Please

    dim cn, rs<BR>Set cn = Server.CreateObject("ADODB.Connection")<BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR>cn.Conne ctionString = "Provider=SQLOLEDB.1;Persist Security Info=True;Password=;User ID=sa;Initial Catalog=ssbiblio;Data Source=(local)"<BR>cn.Open<BR>rs.Open "SELECT * FROM STATES", cn, 3, 3, 1<BR><BR>If you use dsns, you can open the connection via the dsn instead of the connection string<BR>

Posting Permissions

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