database connection

Best way for connecting to a database e.g. SQL Server 2000? Interface to Crystal report 9?


  • Set objConn = Server.CreateObject("ADODB.Connection")
    ObjConn.Open "Provider=SQLOLEDB.1; SERVER=your server name; Database=Your database name ; uid=username ; password=password"

    'Example of your query
    strSQL = "Select * From Main"

    'set record set
    Set rst = Server.CreateObject ("ADODB.Recordset")
    'execute your query
    rst.Open strSQL,objConn,3,3
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion