none
ODBC -- connection to sqlserver failed

    Question

  • HI, 

    Iam new to .net and i have developed a app with asp.net and ms access. When I am trying to host in IIS(localhost) am getting the following errors

    ODBC CONNECTION TO SQLSERVER DS-4\SQLEXPRESS FAILED. ERROR CONNECTING TO THE DATABASE.

    When I executed in visual studio its working fine.. so anything i want setup in local machine.. 

    Thanks in advance

    • Moved by Bob BeaucheminMVP Tuesday, April 24, 2012 2:28 AM Moving to a more appropriate forum for the OleDb provider to .NET (From:.NET Framework inside SQL Server)
    Monday, April 23, 2012 10:32 AM

All replies

  • Are you able to connect to SQL Server via SSMS. if yes then check your connection string, probably something is wrong on your connection string.

    Thanks
    Manish

    Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Monday, April 23, 2012 10:35 AM
  • string sFilePath = Server.MapPath("~/App_Data/Full_ins.mdb");

    OleDbConnection Conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sFilePath + ";"

    this is my conn string. Its working in visual studio after pressing F5 but not in localhost iis

    Monday, April 23, 2012 10:40 AM
  • Your connection string seems to be used to connect with MSAccess, There is not any information about SQLServer database.

    please refer http://connectionstrings.com/access-2007


    Thanks
    Manish

    Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Monday, April 23, 2012 10:51 AM
  • yes, it is for ms access only when iam creating virtual dir for that app in iis am getting this errors.. Please solve
    Monday, April 23, 2012 10:54 AM
  • Could you please post the error, as the error you mentioned seems to be of SQL SERVER, where as you are trying to connect to MSAccess.


    Thanks
    Manish

    Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Tuesday, April 24, 2012 8:37 AM