classic asp can't connect sql server [Answered]RSS

2 replies

Last post Oct 23, 2017 07:17 AM by Yuk Ding

  • classic asp can't connect sql server

    Oct 22, 2017 02:06 PM|jimschan|LINK


    I'm testing this code to connect sql server, but the page didn't savethe data to sql server. Is there any configuration that I need to set to enable the connection?

    <form name="Form" action="*.asp" method="post">
    <input name="Name" type="text"><br>
    <input name="Password" type="password"><br>
    <input  type="submit">

     dim sql
     sql ="select * from table-name "
     set conn=server.createobject("adodb.connection") "provider=sqloledb;source=local;uid=sa;pwd=*******;database=db-name"
     set rs=server.createobject("adodb.recordset") sql,conn,3,2
  • Rovastar Rovastar

    5469 Posts



    Re: classic asp can't connect sql server

    Oct 22, 2017 11:06 PM|Rovastar|LINK

    <br> is a good site for showing different ways of connecting to a db.&lt;br&gt;<br>
    Also check for any errors. &lt;br&gt;<br>
    Not working isn't very useful there will be errors in the IIS logs, event log, SQL server logs, etc&lt;br&gt;<br>
    Make sure you see communication to the SQL server. Check firewalls, etc allow connections through to it.&lt;br&gt;<br>
    Oh do not use sa as your account to connect up your db setup a less privileged account.<br>
    Troubleshoot IIS in style
  • Re: classic asp can't connect sql server

    Oct 23, 2017 07:17 AM|Yuk Ding|LINK

    Hi jimschan,

    I didn't find any error which is related to the display of database data in form. So maybe you need to check the connections between IIS and sql server. Just ensure your connection string could be accessed. Please check sql server authentication log could help you fix this issue. In IIS, you should not require to configure anything unless you need to use IIS connection string.

    Bes Regards,

    Yuk Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.