Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Connection error on ASP classic and SQL Server 2008?

Results 1 to 6 of 6
Share This Thread →
  1. #1
    nicnic is offline Registered User
    Join Date
    Sep 2011
    Posts
    3
    Rep Power
    0

    Connection error on ASP classic and SQL Server 2008?

    I want to use ASP with SQL 2008 but my connection do not work . help me plz



    Microsoft OLE DB Provider for SQL Server error '80004005'

    [DBNETLIB][ConnectionOpen (Invalid Instance()).]Invalid connection.

    /test/test.asp, line 19



    -------------------------------------
    source of test.asp
    -------------------------------------
    'MS SQL Server OLE Driver

    strCon = "Provider=SQLOLEDB;Server=localhost;
    Database=test;User ID=test;Password=test;
    Trusted_Connection=False;"

    Set adoCon = Server.CreateObject("ADODB.Connection")
    adoCon.connectionstring = strCon
    adoCon.Open

    set rs = adoCon.execute("select * from test_table")

    do while not rs.eof
    test = rs("test")
    rs.movenext
    loop

    rs.Close
    set rs = Nothing

    adoCon.Close
    set adoCon = Nothing
    ------------------------------------

  2. #2
    micky's Avatar
    micky is offline Couch Potato Wizard
    Join Date
    Jan 2005
    Location
    India
    Posts
    13,652
    Rep Power
    2685
    Hi and welcome to the forums!

    It might be an issue with your connection string.
    Have a look at this link for connection string

    http://www.connectionstrings.com/sql-server-2008
    Laziness is my religion and Sunday is my God

    Get the Mantra!

  3. #3
    nicnic is offline Registered User
    Join Date
    Sep 2011
    Posts
    3
    Rep Power
    0

    NOT work!

    I tried other connections ways but it did not work !
    plz help me

    Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=test;User Id=test;Password=test;

    Provider=SQLOLEDB;Server=localhost;User ID=test;Password=test;Database=test;

  4. #4
    micky's Avatar
    micky is offline Couch Potato Wizard
    Join Date
    Jan 2005
    Location
    India
    Posts
    13,652
    Rep Power
    2685
    Did you get the same error when you tried those??

    Did you try this one?
    Code:
    Provider=SQLNCLI10;Server=myServerAddress;Database=myDataBase;Uid=myUsername; Pwd=myPassword;
    Please mention the error also.

    Search google also, there might be a permission issue with the database.

  5. #5
    nicnic is offline Registered User
    Join Date
    Sep 2011
    Posts
    3
    Rep Power
    0

    Login failed

    Microsoft SQL Server Native Client 10.0 error '80040e4d'

    Login failed for user 'test'.

    /test/test.asp, line 21

  6. #6
    micky's Avatar
    micky is offline Couch Potato Wizard
    Join Date
    Jan 2005
    Location
    India
    Posts
    13,652
    Rep Power
    2685
    Check the login details, and make sure that they are correct.

    Have a look at this link and see if it helps
    http://social.msdn.microsoft.com/For...-35ac302b8d8d/

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. newbie question - SQL connection string
    By vbmntv in forum .NET Development
    Replies: 3
    Last Post: December 2nd, 2005, 12:47 PM
  2. Classic ASP and SQL 2000 Cluster! Help!!!
    By skillaid in forum Microsoft SQL Server
    Replies: 1
    Last Post: May 19th, 2005, 02:36 PM
  3. Replies: 2
    Last Post: March 31st, 2004, 10:02 AM

ASP Free Advertisers and Affiliates