SQL > ASP Connection

Results 1 to 2 of 2

Thread: SQL > ASP Connection

  1. #1
    Join Date
    Dec 1969

    Default SQL > ASP Connection

    I am very new to this and i do not understand why I am getting this error, i am simply trying to connect to a sql 7 db via the system dsn like this :<BR>&#060;%<BR>Dim objConn<BR>Set objConn = Server.CreateObject("ADoDB.Connection")<BR> objConn.ConnectString = "DSN=Catalog"<BR> objConn.Open<BR>%&#062;<BR>But I am getting the error :<BR>Error Type:<BR>Microsoft VBScript runtime (0x800A01BE)<BR>Object doesn&#039t support named arguments: &#039ConnectString&#039<BR>/Default.asp, line 10<BR>Any Help will be much appreciated !

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL > ASP Connection

    Try passing the Connection String as an argument to the Open method:<BR><BR>&#060;%<BR>Dim objConn<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .Open "Catalog"<BR>%&#062;<BR><BR>OR you can pass all the Connection detail as follows:<BR><BR>&#060;%<BR>Dim objConn<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .Open "DATABASE=catalogdb;DSN=Catalog;UID=sa;Password=;" <BR>%&#062;<BR><BR>Here I am assuming that your database name is catlogdb.

Posting Permissions

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