开发者

ADODB.Connection (0x800A0E78)

开发者 https://www.devze.com 2023-03-05 09:08 出处:网络
Original connectionstring whitch working on MSSQL 2000: Provider=SQLOLEDB.1; Persist Security Info=True; User ID=XXXXXXXX; Initial Catalog=IntranetApps; Data Source=MS; Use Procedure for Prepare=1;

Original connectionstring whitch working on MSSQL 2000:

Provider=SQLOLEDB.1; Persist Security Info=True; User ID=XXXXXXXX; Initial Catalog=IntranetApps; Data Source=MS; Use Procedure for Prepare=1; Auto Translate=True; Packet Size=4096; Workstation ID=datawriter; Password=XXXXXXXX';

New connectionstring which not working on MSSQL 2008:

Provider=SQLNCLI10;Server=PR-NB-CIS011\SQLEXPRESS;Database=IntranetApps;Uid=XXXXXXXX;Pwd=XXXXXXXX;

I tryed change provider to SQLNCLI10.1, without provider, ...

Once in past i solved same problem, but hell, i don't remember it now. I thing that there was needed install some provider, but i can find nothing about it now.

There is code witch throw exception:

thi开发者_如何学Gos.connection = new ActiveXObject("ADODB.Connection");
    this.connection.ConnectionString = this.conString;
    try {
        this.connection.Open;
    }
    catch(e){
        Response.write("Chyba pri pripojeni na db.");
        return false; // pokud dojde k chybe pri pripojovani k databazi, pak fce vraci false, jinak true
    }


If this really is a connection string problem, you should:

  1. study the basics
  2. create a zero length "whatever.udl" file and start it from command line; you can then twiddle the parameters, test the connection, and paste the connection string from the clipboard
  3. try ";Data Source=PR-NB-CIS011\SQLEXPRESS;" instead of ";Server=PR-NB-CIS011\SQLEXPRESS;"


After call Open, there is exception: "[DBNETLIB][ConnectionOpen (Connect()).]SQL Server neexistuje nebo byl odepřen přístup." (I didn't find exact localization, it means: "Server not exist or acces denied.") number: -2147467259

In this case it appears the server specified in your connection string does not exist, is not running or the user account you've provided doesn't have sufficient permissions.

Things to try:

1) Your connection string is not correctly formatted for SQL Express 2008, try this:

Server=PR-NB-CIS011\SQLEXPRESS;Database=IntranetApps;User Id=XXXXXXXX;Password=XXXXXXXX;

2) When you open Management Studio, try and connect with the username and password of your connection string. This sometimes makes it quicker and easier to find and trace permissions issues.

3) If you're logging in with a SQL server user account, make sure you have SQL server and windows authentication enabled. To do this, in SQL Management Studio, right click the server, Properties, and on the Security tab, check 'SQL Server and Windows Authentication mode'

0

精彩评论

暂无评论...
验证码 换一张
取 消