?
Solved

missing parameter type

Posted on 2001-08-12
1
Medium Priority
?
697 Views
Last Modified: 2007-12-19
Hi,

Got a missing parameter type for this function below:
function GetDataType(Table1.FieldDefs[i].DataType:string):TFieldType ;

Any suggestions?
0
Comment
Question by:rhapsody7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 21

Accepted Solution

by:
gemarti earned 20 total points
ID: 6377591
I don't think you can convert a datatype to a string.

Try this:

place a datasource, table, button and a standard listbox on a form

attach the table to a database and link the datasource then run this application:

NOTE: Since this q is only worth 5 points I am not including all of the datatypes available in this code. You'll have to do that yourself:

--------------cut below this line--------------------------

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, DBTables, DBCtrls, Mask, ExtCtrls;

type
  TForm1 = class(TForm)
    DataSource1: TDataSource;
    Table1: TTable;
    Button1: TButton;
    ListBox1: TListBox;
    procedure FormActivate(Sender: TObject);
    procedure ListBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.FormActivate(Sender: TObject);
var
  i : integer;
begin
  for i := 0 to Table1.FieldList.Count -1 do
    //begin
      ListBox1.Items.Add(Table1.FieldList.Strings[i]);
    //end;
end;

procedure TForm1.ListBox1Click(Sender: TObject);
var
  Fname : String;
  i : Integer;
begin
  i := ListBox1.ItemIndex;
  Fname := ListBox1.Items.Strings[i];
  Case Table1.Fields.FieldByName(FName).DataType of
  ftUnknown: ShowMessage('FtUnknown: Unknown or undetermined');
  ftString: ShowMessage('ftString: Character or string field');
  ftSmallint: ShowMessage('ftSmallInt: 16-bit integer field');
  ftInteger: ShowMessage('ftInteger: 32-bit integer field');
  ftWord: ShowMessage('ftWord: 16-bit unsigned integer field');
  ftBoolean: ShowMessage('ftBoolean: Boolean field');
  ftFloat: ShowMessage('ftFloat: Floating-point numeric field');
  ftCurrency: ShowMessage('ftCurrency: Money field');
  ftBCD: ShowMessage('ftBCD: Binary-Coded Decimal field that can be converted to Currency type without a loss of precision.');
  ftDate: ShowMessage('ftDate: Date field');
  ftTime: ShowMessage('ftTime: Time field');
  ftDateTime: ShowMessage('ftDateTime: Date and time field');
end;

end.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question