Skip to main content
Inspiring
September 15, 2012
Question

Connection problems between SQL Server 2012 databases and ColdFusion 10

  • September 15, 2012
  • 1 reply
  • 5657 views

I am running ColdFusion 10 and SQL Server 2012.

I am not able to connect databases through the CF Administrator.

The error displayed is:

Connection verification failed for data source MyDB.

java.sql SQL.NonTransientException" [Macromedia][SQL Server JDBC Driver][SQL Server][Cannot open database "C:\ColdFusion10\cfusion\db\MyDB" requested by the login. The login failed.

The root cause was that java.sql.SQLNonTransientException [Macromedia][SQL Server JDBCDriver][SQL Server][Cannot open database C:\ColdFusion10\cfusion\db\MyDB" requested by the login. The login failed.

I have tried the things suggested in the forums - checking that the TCP/IPs are enabled in SQL Server, that the port is set to 1433 in each case, authentication is mixed (SQL Server and Windows), both programs are allowed through Windows Firewall, etc.

Could the problem be that the latest versions of SQL Server and CF are somehow not compatible?

Thanks in advance for any comments/suggestions.

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    September 15, 2012

    The problem obviously relates to the database name. This is wrong: C:\ColdFusion10\cfusion\db\MyDB. Follow the instructions on connecting Coldfusion with Microsoft SQL Server.

    Inspiring
    September 15, 2012

    Thanks for the link.

    I followed the instructions there; first when creating a new log-in in SQL Server I received a strange message:

    An exception occurred while executing a Transact SQL statement or batch.

    (Microsoft SqlServer ConnectionInfo)

    An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name. (Microsoft SQL Server, Error: 1038).

    I managed to get past this problem, and completed the work with SQL Server.

    Upon going into the CF Administrator and following the linked instructions, firstly I have to enter a User name, otherwise I am prompted for one. I then receive the message:

    The password of the account must be changed.

    This is despite entering the correct password. If I enter a wrong password, the CF Administrator error changes to:

    Login failed for user 'xxxxx'.

    Anyone any ideas?

    Inspiring
    September 15, 2012

    I solved the last problem mentioned by unclicking "User must change password at next login".

    However the CF Administrator now throws up the error:

    Cannot open database requested by the login.

    This is after several seconds of trying to connect.

    I have tried putting the database in different directories (C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\MyDB,  C:\ColdFusion10\Cfusion\wwwroot\MyDB, C:\ColdFusion10\Cfusion\db\MyDB, etc), all to no avail.