I realise that the most common answer to this question is that I am using a constant without incluing the definition, but that isn't the case here. I also understand that it is likely to be a simple error that I can't see because I'm looking for something more complex, but here goes:
Every page of my code is now, suddenly, failing on the ActiveConnection with an error of 800a0bb9 "Arguments of the wrong type, or out of acceptable range"
The trouble is, the error is occuring on the line that sets the connection. So, my code (from the top) is:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<script language="VBSCRIPT" runat="server" src="vbs/vbadovbs.vbs"></script>
<script language="VBSCRIPT" runat="server" src="vbs/globalfunctions.vbs"></script>
<script language="VBSCRIPT" runat="server" src="vbs/connection.vbs"></script>
<%
Set cmd = CreateObject("ADODB.Command")
cmd.CommandType = adcmdStoredProc
cmd.CommandTimeout = 0
cmd.Prepared = True
cmd.ActiveConnection = "Driver={SQL Server};Server=ServerX;Database=dbX;UID=UserX;PWD=PasswordX;"
cmd.Parameters.Append cmd.CreateParameter("@RETURN_VALUE", adParamReturnValue, 4)
cmd.CommandText = "ValUser"
cmd.Execute
The error occurs on the line cmd.ActiveConnection = "Driver={SQL Server};Server=ServerX;Database=dbX;UID=UserX;PWD=PasswordX;"
I've tried using a connection string variable (in connection.vbs), putting the full string into the page, creating a connection object and using that, none of it works.
The unhelpful thing about it, is this worked on Wednesday when I was developing it. Yet, the next day it had stopped working. The exact same code also works fine from my webserver when connecting to a different database for my website), becuase I copied and pasted the connection as I always do.
Any help would be massively appreciated as this is starting to really nark me now!!!
Every page of my code is now, suddenly, failing on the ActiveConnection with an error of 800a0bb9 "Arguments of the wrong type, or out of acceptable range"
The trouble is, the error is occuring on the line that sets the connection. So, my code (from the top) is:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<script language="VBSCRIPT" runat="server" src="vbs/vbadovbs.vbs"></script>
<script language="VBSCRIPT" runat="server" src="vbs/globalfunctions.vbs"></script>
<script language="VBSCRIPT" runat="server" src="vbs/connection.vbs"></script>
<%
Set cmd = CreateObject("ADODB.Command")
cmd.CommandType = adcmdStoredProc
cmd.CommandTimeout = 0
cmd.Prepared = True
cmd.ActiveConnection = "Driver={SQL Server};Server=ServerX;Database=dbX;UID=UserX;PWD=PasswordX;"
cmd.Parameters.Append cmd.CreateParameter("@RETURN_VALUE", adParamReturnValue, 4)
cmd.CommandText = "ValUser"
cmd.Execute
The error occurs on the line cmd.ActiveConnection = "Driver={SQL Server};Server=ServerX;Database=dbX;UID=UserX;PWD=PasswordX;"
I've tried using a connection string variable (in connection.vbs), putting the full string into the page, creating a connection object and using that, none of it works.
The unhelpful thing about it, is this worked on Wednesday when I was developing it. Yet, the next day it had stopped working. The exact same code also works fine from my webserver when connecting to a different database for my website), becuase I copied and pasted the connection as I always do.
Any help would be massively appreciated as this is starting to really nark me now!!!