DSN connection problem

Results 1 to 2 of 2

Thread: DSN connection problem

  1. #1
    Join Date
    Dec 1969

    Default DSN connection problem

    To be honest I haven&#039;t used a DSN connection, I have just tried to set one up on my home machine and am having problems connecting:<BR><BR>This is the code I am using:<BR>&#060;% <BR> Dim objConn<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.ConnectionString = "DSN=furious5.dsn"<BR> objConn.Open<BR> <BR> Dim objRS<BR> Set objRS = Server.CreateObject("ADODB.Recordset")<BR> objRS.Open vSQL, objConn<BR> <BR> vSQL = "select * from news"<BR> Do While Not objRS.EOF<BR> Response.Write objRS(0)<BR> Response.Write "&#060;p&#062;"<BR> Response.Write objRS(1)<BR> Response.Write "&#060;p&#062;"<BR> Response.Write objRS(2)<BR> Response.Write "&#060;p&#062;"<BR> Response.Write objRS(3)<BR> ObjRS.MoveNext<BR> Loop<BR> <BR> Set ObjRS = Nothing<BR> Set ObjConn = Nothing<BR> %&#062;<BR><BR>This is the error:<BR><BR>Error Type:<BR>ADODB.Recordset (0x800A0BB9)<BR>Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.<BR>/news.asp, line 24<BR><BR>Any ideas?

  2. #2
    Join Date
    Dec 1969

    Default Here's your error...

    You have to put the vSQL statment in before the Recordset opens it... Try that and it should work just fine.

Posting Permissions

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