Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by ���ܵ�Сʨ
Sat, 18 Apr 1998 00:00
��Delphi�����ݿ�Ӧ�õļ������
Author: ���ܵ�Сʨ
Date: Sat, 18 Apr 1998 00:00
Date: Sat, 18 Apr 1998 00:00
76 lines
6307 bytes
6307 bytes
Delphi��һ�������ǰ�˿�������,�ܹ���ݵز���������õ�Ӧ
�ó�������ݿ�Ӧ����Ʒ���,DelphiҲ����ǿ��Ĺ��ܡ�����һ
���ϴ����ݿ�Ӧ������ֻҪ�̵ܶ�ʱ�伴����ɡ��ڴ˱�����̸̸
�ڱ�̹���л��۵�һ����ᡣ
Delphi�ṩ��������ݷ��ʺͿ��ƵĿ��ӿؼ�,����Щ�ؼ�����
������ݿ�Ӧ�á�Data Access�ؼ���Ҫ���ڷ�����ݼ�¼,���ѯ��
���롢ɾ��Ȳ���,Data Controls�ؼ�����Ҫ���ڱ�����ʾ,��Ȼ
Ҳ�ɽ���һЩ�༭��
Delphi����ݿ�Ӧ��ͨ��Data Access�ؼ���BDE����,�Ӷ����
���Դ��Data Control s�ؼ���Щ��νData_Aware�ؼ�,�ṩ�û���
�ڡ�����BDE(Borland Database Engineer)֧��ODBC��,���Կ���
���ʶ������Դ���
ʹ��SQLʱ��һЩ����
Delphi����ݿؼ���֧�ֱ�SQL����,����Щ���ơ��ھ����
��ʱ���ܻ�����һЩ�鷳��
ͼ1
1.Query�ؼ���Open��ExecSQL��ʽ�����Open��ʽ���Դ���
��ϵ����ݱ��,��Ex ecSQL��ʽ��ֻ������SQL���,���������к�
�ı������������Data-Controls�ؼ������, ���Ҫ��DBGrid����
��ʾҪ�����ݼ�¼ʱ,����SELECT���ɸѡ�����Ҫ���Ԫ��,����
O pen��Query�ؼ����в������ɡ����������µ�Ӧ��:
���Ҫ��DBGridl����ʾ���(�����ΪWORKERS.DB),��ɽ�Quer
y1��SQL������Ϊ:SEL ECT*FROM WORKERS,���ڳ����м������:Quer
y1.Open;���ɡ���Ҫ����һ����¼,��Query1 ��SQL����ӦΪ:
INSERT INTO WORKERS(No#,Name,Sex,Age,Depart) VALUES
(:No#,:Name,:Sex,Age,:Depart)
�ڳ�������Ӧ�ü����������:
Query1.Close;
Query1.ParamByName(��No#').asintegar:=2717;
Query1.ParamByName(��Name').asstring:=������';
Query1.ParamByName(��Sex').asstring=����';
Query1.ParamByName(��Age').asinteger:=40;
Query1.ParamByName(��Depart').asstring:=��Ʒ�ʹ��?;
Query1.ExecSQL;
ע��,�˴������ExecSQL����Open�����?
2.��Ҫ��SQL�����ʹ�ó����еı���,ֻ����SQL������ð�ż�
�ֶ���������,Ȼ���ڳ����аѱ�����ֵ�����ֶΡ���������ӱ���
������ɵġ�����,���û�����һ�����Ŵ���Nu mber������,Ҫ��ѯ
��Ӧ�ļ�¼ʱSQL���Ӧ����:
SELECT*FROM WORKERS WHERE No#=:No#
���ڳ����м����������:
Query1.Close;
Query1.ParamByName(��No#').asinteger:=Number;
Query1.Open;
ʹ������ʱ��ע������
1.Ҫ��Delphi���Ƶ���ݿ�Ӧ�ó�����ʹ������,�����BDE Con
figuration������ȷ����,��Ҫ�Ƕ������Ե�ѡ��Delphi 1.0
����,����BDE Configuration Utility��Syst emҳ�н�LANGDRIVER
����ΪdBASE CHS CP936,��Delphi 2.0,��ɽ�Systemҳ�е�LANG-DR
I VER����ΪSybase SQL Dic850�����úú�,Delphi�е���ݷ��ʿ�
������ݿ��ƿؼ��Ϳ���ʹ�������ˡ�ֵ��ע�����,���������
��֧�����ĵ�BDE�����в����,��ʹ��ʹ��ʱBD E�Ѿ�����Ϊ֧����
��Ҳ����������,��ʱ����DATABASE DESKTOP���ı������ԡ���T
ab le Property�е�Table Langue��Ϊ֧�����ĵ������Լ��ɡ�
2.���Ŀ��������ֶ���,������ȷ��ʾ,������PASCAL����Ҫ���
����Ϊ��Ӣ����ĸΪ����ĸ���ִ�,���Ժ����ַ�����������
��������������������ֶ���,ʹ��SQLʱҪʮ��С��,��������
����������ֶν��и�ֵ��Ƚ�ʱ���������漸��SQL�����ʹ��ʱ
�������:
SELECT*FROM TEST WHERE����=:����
INSERT INTO TEST(����,Age,Salary)values(:����,:Age,:Sala
ry)
ע��汾֮��IJ���
Delphi 1.0��Delphi2.0�ڶ���ݿ�Ĵ�������Щ���,ʹ�ù��
��Ҫ����ע�⡣����D elphi 1.0�ı���ֶ���Ŀ����̫��,����10��
�ֶ�ʱ������INSERT�������¼,��Delp hi 2.0����������
�ơ�����,�����йؼ��ֵ�PARADOX�����в����¼ʱ,Delphi 1.0
������ԭ�еĹؼ�����ͬ�ļ�¼,��Delphi 2.0���������ؼ���
�Ѵ��ڵļ�¼,���ִ�������ֲ���,��ݿ��ʹ�ý����ò���
--
[m[1;37m�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: hsia.nju.edu.cn][m
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads