Technical Information Database TI1402D.txt - Connecting to a 32-bit Sybase server Category :Database Programming Platform :All-32Bit Product : Description: Connecting To Sybase 32-bit This TI will instruct you on how to connect to a Sybase database via Borland's native 32-bit Sybase SQL Links packaged with Delphi 2.x. The Sybase client software should take up approximately 10+ megabytes of hard drive space. Steps To Connect: 1. Make sure that the SQL Links package is installed on your local drive. If you installed the full package of Delphi 2.x then it should be installed already. 2. Install the Sybase client software. 3. When prompted during installation to install either the 16 or 32 bit Sybase links, choose only 32-bit by checking the check box next to the 32-bit selection and making sure that the check box next to the 16-bit selection is blank. 4. After the client software is installed on your hard drive, you will be asked if you would like the install program to automatically update your AUTOEXEC.BAT file. You should choose YES. 5. When prompted to edit your SQL.INI file, choose yes. 6. In the "Input Server Name:" section, type in the alias of the server. Click on the 'Add' button to add this name to your "Server Entry:" list. Next, make sure that the "Service Type:" (It should be 'query'), the "Platform:" (it usually defaults to either NT, dos, or Win3), and the "Net-Library Driver:" (should default to either NLWNSCK or NLNWLINK) edit boxes are correct. Fill out the "Connection Information/Network Address:" by entering the network address of the server you will be connecting to in this edit box. click on the 'Add Service' button. You should now be able to Ping your server by clicking on the 'Ping' button. Exit and save the current settings. 7. Shutdown and Restart your machine. 8. Goto the Delphi program group and execute the Database Explorer. 9. In the Database explorer, make sure that you are on the Database tab. In the pull down menus, choose Object | New... A dialog box should appear with the name STANDARD next to a down arrow. Click the down arrow and select SYBASE from the list that is displayed. 10. There should now be an Alias for your Sybase connection called SYBASE1. Make sure that this name is highlighted. Click on the definitions tab in the Database Explorer. Under the "Server Name" section, type the name of one of the servers that you entered in your SQL.INI that you were able to Ping. In the "User Name" section type the name of a user with rights to the server specified in your "Server Name" section. Make sure that you know the password of the user name that you just specified. 11. Double click on the alias name (SYBASE1) and you should be prompted for a User Name and Password. The User Name should default to the name you specified in the "User Name" section of the Sybase Alias. Type in the password that corresponds to this User. Click on the OK button. You should now see a little green box around the icon next to the Sybase Alias (SYBASE1). This means that you are connected. Testing your Connection within Delphi 2.x: 1. Drop a TDataSource, a TTable, and a TDBGrid on a blank form. 2. In the Object Inspector for the TDataSource, Set the DataSet to 'Table1'(no quotes). 3. In the Object Inspector for the TTable, set the DataBase Name to SYBASE1. Scroll down to the TableName property and double click on the edit box next to it. You should be prompted for a user name and a password. The user name that you entered in the Database Explorer for the Sybase Alias should already be displayed. Enter the corresponding password. Click the OK button. 4. You should now see a list of table names. Choose one of these names. 5. Click on the TDBGrid. Set the DataSource Property to DataSource1. 6. Set the Active property of the TTable to TRUE. 7. You should now see the data in the TDBGrid. When you run this application, you will be prompted for the username/password. Type in your password and click OK. You should now see the data in the grid. Error Messages: Unable to determine net-library error: This error means that the .DLL's needed are nowhere to be found. These files should be in your \Sybase\DLL directory: Libblk.dll Libcomn.dll Libcs.dll Libct.dll Libintl.dll Libsrv.dll Libsybdb.dll Libtcl.dll Mscvrt10.dll Nldecnet.dll Nlmsnmp.dll Nlnwadvt.exe Nlnwlink.dll Nlwnsck.dll Disclaimer: This document does not promise a connection, it only shows the best and fastest way to connect. Reference: 4/22/99 12:54:21 PM
Last Modified: 01-SEP-99