Help! Problems connecting to SQL 2005 from Delphi

  • I have a system written in Delphi. We recently ported it from using BDE to ADO. I have an installation where I have installed SQL 2005. I attached the existing database used by my system and set the compatibility level to 80 (SQL 2000) which my system is coded to. I am able to connect to the database using the standard parameters using Studio Management or SQLCMD. However my system is unable to connect though another site is working fine using the similar parameters. Below is a sampe of the ADO parameters that my sys tem uses:

    ADOCONN='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;password=pppppppppp;Initial Catalog=

    where

    pppppppppp = password configured upon installation for the sa user

    = my database name

    = used the machine name or localhost

    The above does not want to work though a similar configuration at another site works. The difference is that the SQL instance at the working side has a specific name while I opted for the 'default' instance when installing this current site.

    Any pointers to something that I may have missed?

  • Perhaps you used some characters that were filtered out in your post, but your connection string does not include a database name or a server name.

    Also, is it possible that you forgot to enable SQL Authentication? I would recommend you switch to Windows Authentication as soon as you can - and in the interim, I would suggest you do not use the sa login for your application. Configure another login with appropriate permissions and keep sa to yourself.

  • Here is the string:

    ADOCONN='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;password=password;Initial Catalog=databasename;Data Source=sqlservername'

    I used tags in the initial post and these were most probably rejected.

    I have also set the server to use mixed mode.

    The above connection string is in a ini file of text format. My program uses the ADOCONN tag to read the string in and parse it for the different parameters.

  • Did you enable TCP/IP on your SQL Server instance? It's defaulted to false with 2005

    You can check here

    C:\WINDOWS\system32\mmc.exe /32 "C:\WINDOWS\system32\SQLServerManager.msc"

  • hi, having same prob as explained above. So if theirs any solutions pls reply.

  • try to connect with ip and portnumber.

    Also check on the actual SQL server,

    either TCP/IP and any other required protocol is enabled for sql server or not.

    ----------
    Ashish

  • i dont think any protocol prob is thr, since using same sql server we are able to connect thru c# but not with delphi

  • try to do the telnet with sqlip sqlportnumber.

    Is it responding from both machine?

    ----------
    Ashish

  • connection failed is coming

  • contact your network team and tell them to open the port on this server.

    ----------
    Ashish

  • can u let me knw which port

  • can you let me knw which port

  • the port which you configured for your sql instance.

    by default its 1433.

    Check the configuration manager to know the port number of your sql instance.

    ----------
    Ashish

  • its port 1433 only..and have checkd with systems..port is open.

    connection string we are using as below, and we are accesing sql on server.

    'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=true;' +

    'Data Source=' + xxx.xx.xxx.xx+ ';'+

    'Initial Catalog=' + db_xyx+ ';'+

    'User ID=xyzs;Password=abc'

  • ok, thats really surprising as getting two contradictory answer.

    You said telnet is failing but network team says the port is open.

    the syntax for telnet is :-

    telnet ip port

    for ex

    telnet 1.1.1.1 1433

    no comma, nothing else

    just mentioning in case you incorrectly did the telnet check

    After this, I would like to do one more testing :-

    1) Go to start--run--odbcad32.exe

    2) It will open the ODBC configuration wizard. Try to do the test connection from here by configuring all the required parameter in "user dsn" or "system dsn" using driver as "sql server"

    3) in the server details window, try connecting with ip,portnumber so 1.1.1.1,1433.

    Is this working?

    ----------
    Ashish

Viewing 15 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic. Login to reply