Board index » delphi » SQL Server as a db backend to Delphi

SQL Server as a db backend to Delphi

Has anyone out there successfully worked with a SQL Server (MS)
database using Delphi 2? I'm having difficulty actually getting
to the data.  My SQL Server db has a bunch of data, and I can
get a connection to the database.  However I cant get the data
to show up in my grid (or any data aware control).
If anyone has an example or a source for a solution to this
problem, please let me know.  (I'm also curious as to the
interaction between the IndexFieldName and SQL Server indexes)

thanks

 

Re:SQL Server as a db backend to Delphi


Quote
bruce rahn <br...@lisco.com> wrote:
>Has anyone out there successfully worked with a SQL Server (MS)
>database using Delphi 2? I'm having difficulty actually getting
>to the data.  My SQL Server db has a bunch of data, and I can
>get a connection to the database.  However I cant get the data
>to show up in my grid (or any data aware control).
>If anyone has an example or a source for a solution to this
>problem, please let me know.  (I'm also curious as to the
>interaction between the IndexFieldName and SQL Server indexes)
>thanks

What version of MS SQL server do you use.
With 4.21a you need to define a primary key on the table before Delphi
1.0 will let you access the data, I'm not to sure with SQL 6.0 and
Delphi 2.0 as all my data tables have keys defined, It's always good
practice to define primary keys and indexes on tables. I use SQL 6.0
and Delphi 2.0 without much trouble. I use the SQL Links ( MSSQL
Link). Check all you datacontrol and datasource properties are
pointing to the correct tables. Maybe you can give me more info then
i'll be able to help more.

With respect to indexes, SQL 4.21 doesn't use your IndexFieldName
information and will choose it's own index when tables are queried or
accessed using it's own internal set of rules. You have no control
over this when using a table control. I'm not sure about SQL 6.0 but
assume it does the same thing.

Paul

Other Threads