locked
Moved to Amazon server trying to connect to database RRS feed

  • Question

  • User666210452 posted

    Moved to a new server and trying to connect to it on an ASP page.  Can anyone tell me what I have that is wrong here.  I renamed the server, database, and password. 

    <%

                   Dim myYear, mysql

                   myYear = Request("Year")

                   'Set location to database

                   dim Conn, sqlstate

                   sqlState = "myserver.cmhizh7ejicx.us-west-2.rds.amazonaws.com;Database=Mydb;User ID=admin;Password=my password"

        set Conn = Server.CreateObject("MSOLEDBSQL.Connection")

        Conn.open sqlstate

                   Dim cnCon, rstemp

    Sunday, March 21, 2021 5:52 PM

All replies

  • User1065476709 posted

    Hi dmaier,

    Moved to a new server and trying to connect to it on an ASP page.  Can anyone tell me what I have that is wrong here.  I renamed the server, database, and password. 

    Did you get any error? Do you have a problem with the code? If yes, you can refer to this link about how to connect to a sql database using classic asp.

    https://stackoverflow.com/questions/1569303/how-to-connect-to-a-sql-database-using-classic-asp

    Best regards,

    Sam

    Monday, March 22, 2021 1:52 AM
  • User666210452 posted

    Yes.  I got an error it just says

    500 - Internal server error.

    There is a problem with the resource you are looking for, and it cannot be displayed.

    I have used the code on another server and it worked fine.  ASP is installed on the server.  I believe there is something about the code for the connection to the SQL server.

    Monday, March 22, 2021 12:15 PM
  • User1065476709 posted

    Hi dmaier,

    You mean your code can work normally on another server, but not on this one?

    Do you have the details for the 500 error? For example, the sub-status code?

    Or you can check whether there are related error messages in the Event Viewer.

    Best regards,

    Sam

    Tuesday, March 23, 2021 9:50 AM
  • User1085532143 posted

    Can you explain in more detail? I still do not understand after looking

    Friday, March 26, 2021 2:25 AM