简体   繁体   中英

Delphi ADO can't find MSSQL 2019 server

I needed to update my old 2008 MSSQL to 2019 Express. (Both accessed locally on the same computer)

This works as far as I can tell since I can see my database in SQL Server Management Studio. So seems to me that is working. (The way I test is I also make sure to have the old server shut down while testing on the new.)

However, my old Delphi 2010 software (which uses some old components for other things making it hard to upgrade) can not connect to MSSQL2019 through ADO it seems...

To make the example simple... I have my TADOConnection in my IDE. As server to connect to I choose my own computer where MSSQLServerExpress2019 is installed. (Same with 2008) I select "Use Window NT Integrated security" (which I also chose for MSSQL2019Express)

I then try select the database on server... This gives error:

[D.NETLIB[ConnectionOpen (Connect().]SQL Server does not exist or access denied

I am trying to determine... How can I solve this. I am kinda surprised the ADO mechanism stopped working... Maybe there are some settings in my MSSQL2019Express I can set?

The connection string is:

Provider=SQLOLEDB.1;Password=xxx;Persist Security Info=True;User ID=XX;Initial Catalog=XXXXX;Data Source=mySERVERINSTANCE

HAVE TRIED

  1. In SQL Server Configuration I have in protocol for MSSQLExpress 2019 enabled TCP/IP (I can see I still have it disabled for my old MSSQL2008)

  2. In SQL Server Configuration I have in protocol for MSSQLExpress 2019 enabled Named pipes (I can see I still have it disabled for my old MSSQL2008)

  3. In DelphiXE4 I just also tried ADO connection in IDE. Here I have tried "Microsoft OLE DB Provider for SQL Server". Same error.

  4. In DelphiXE4 I just also tried ADO connection in IDE. Here I have tried "SQLNCLI11.1" for provider. This gives error comparable error.

I appears using Source=.\SQLEXPRESS or Source=MyComputer\SQLEXPRESS for MSSQLServer 2019

Funny thing in eg IDE ADO connection I can connect to my 2008 server just using: Source=MyComputer

Thank you everyone. It just been so insanely long time since I last looked at this code, so rusty as hell with everything regarding MSSQL and how my setup was done and where my code did things.

Sorry for all the confusion. But thank you so much for your help.

Hopefully maybe this answer could conceivably be help to someone out there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM