SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem connecting a classic asp project to SQLserver 2008 express via IIS7 on win7 6

    Problem connecting a classic asp project to SQLserver 2008 express with this query strings:

    conn = "Driver={SQL Server Native Client 10.0}; Server=.\SQLEXPRESS; Database= database; Trusted_Connection=yes"
    conn = "Provider=SQLOLEDB;Data Source=.\SQLEXPRESS;Initial Catalog=database;UserID=sa;Password=123"
    conn = "Driver={SQL Server}; Server=.\SQLEXPRESS; Initial Catalog= database;Integrated Security=True;Network Library =dbmssocn"
    conn = "Provider=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=database;Data Source=(local);"
    _______________________
    RETURNED ERROR:
    Classic ASP return this error: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
    _______________________
    SQL Server: Authentication: SQL Server and windows authentication mode
    Iím using IIS7 in a win 64bit
    Do I need a DB user and password in sql DB and querystring? is the iis7? win7 64bit?
    ______________________
    Note: VB.NET can access with this conn String: "Data Source=.\SQLEXPRESS;Initial Catalog=nData;Integrated Security=True"

    Thanks

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,609
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Does that provider run OK in ASP in 64-bit mode? i.e. is it a 64-bit OLEDB provider? If not, try enabling IIS7 to allow 32-bit applications.

    Open IIS7.
    Select Application Pools
    Click on DefaultAppPool
    Click on Advanced Settings
    Expand General (if necessary) and set Enable 32-Bit Applications to True
    Click OK
    (I don't know if you'll need to click on Recycle).

    ... I know the above needs to be done to allow MS Access databases to be used by ASP on IIS7+
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    356
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Why are you resetting the conn variable? You should comment out all but the active connection string. As you have it now, only the last connection string will be used, and it's not using .\SQLEXPRESS as a datasource.
    Doug G
    =====
    "If you ain't the lead dog, the view is always the same - Anon

  4. #4
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,609
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well spotted! Yes - you need to append each line to the conn variable ...

    Code ASP:
    conn = "Driver={SQL Server Native Client 10.0}; Server=.\SQLEXPRESS; Database= database; Trusted_Connection=yes"
    conn = conn & "Provider=SQLOLEDB;Data Source=.\SQLEXPRESS;Initial Catalog=database;UserID=sa;Password=123"
     
    'OR
     
    conn = "Driver={SQL Server}; Server=.\SQLEXPRESS; Initial Catalog= database;Integrated Security=True;Network Library =dbmssocn"
    conn = conn &  "Provider=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=database;Data Source=(local);
    Ian Anderson
    www.siteguru.co.uk

  5. #5
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thanks for the answers.

    Well, Doug G, I'm using only one of those conn Strings.

    I got the problem. It was a user permission issue in SQLexpress.

    Thanks any way


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •