Connecting to a SQL Server with ASP

  • I am trying to setup a SQL server connection with ASP. I have done this many times in Access but am having some problems with SQL. The server is running localy on the web server. I am wanting to put values from the database into drop down boxes for use with other tables. I am new to this so I really need some help.

    Thanks

    garry@acs.ac

  • Dim sConn, objConn, rsTable

    Set objConn = Server.CreateObject("ADODB.Connection")

    Set rsTable = Server.CreateObject("ADODB.RecordSet")

    sConn = "Provider=SQLOLEDB; Data Source=MyServer;" & _

    "Initial Catalog=pubs;User ID=steve;Password=stevespwd"

    objConn.open sConn

    Set rsTable = objConn.Execute("select * from customers"

    Steve Jones

    steve@dkranch.net

Viewing 2 posts - 1 through 1 (of 1 total)

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