Link to home
Start Free TrialLog in
Avatar of mikeydk
mikeydkFlag for Denmark

asked on

BDE - Cannot locate or connect to the SQL server

I have a strange problem accessing a MS SQL Database from my network.

I'm using an application that is based on BDE which uses SQLserver 7 client to connect to a MS SQL DB.
When I tried to connect from the network with BDE - I got this error message:

Cannot locate or connect to the SQL server

On the client side it's an XP SP2 with MS SQL Client installed, same BDE 5.11

When I create an alias using ODBC and mapping to my server, it connects and the communication with the Database Server succeds:
TESTS COMPLETED SUCCESSFULLY!

When I'm trying to connect using BDE Admin and double clicking on the + sign of the alias I created usind ODBC admin I get the message I listed above.

Any help would be appreciated,

Running Windows XP SP3

Mike
Avatar of 8080_Diver
8080_Diver
Flag of United States of America image

I rather suspect that you are about to learn how to use TADO components.  AFAIK, the BDE cannot connect to SQL Server Databases (note: it is MS SQL Server and not MS SQL ;-) after SQL Server 7 (or, possibly, SQL Server 2000).  
You shouldn't be using the BDE anyway (even though it does still ship with Delphi) because it has known issues, has been deprecated, and is no longer supported.  Bite the bullet and convert your SQL Server connections to TADOConnections and use the TADOQuery and other TADO components to access the data.  Also, dont use the TADOTable component and you should start moving to the TADOStoredProcedure component and creating stored procedures in the database.
And remember
OBDC connection can only have one active cursor at a time. By default, odbc only retrieves the first 20 records for a query. If the query contains more than 20 records, the rest are retrieved on demand. That's all very well, but when you open a second query using same connection/session you get the dreaded hstmt error.
So I suggest you move to ADO....
BDE is old .... too old....
ASKER CERTIFIED SOLUTION
Avatar of mikeydk
mikeydk
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Mike,
I still STRONGLY advise bringing your projects into the 21st century and dumping the BDE (as well as avoind the use of table objects and using query objects instead).  There will be a little (or a lot, if you have don't have your connections and data handling in a TDataModule, which is another practice I highly recommend) pain in the beginning but it will make life much, much better.  The BDE has known issues that significantly contributed to it being depracated.