-=-
.
.....
  
 
RSS
Direkomendasikan menggunakan brower Opera/Chrome/Firefox. Resolusi minimal 1024x768 | Powered by ____ |
 
  
 
Nikmati Delphi-ID dalam berbagai versi tampilan :
Basic View (LOW Bandwidth)
Default View (Full)
Mobile Edition
Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
goto Postjumlah komponen maksimal dalam sebuah project(6)
 by d4mnf1y32
 on 21.May at 12:16
goto Posttanya grayscale to biner dengan scanline(1)
 by luckynvic
 on 20.May at 20:44
goto Posttanya looping biner to matriks(1)
 by luckynvic
 on 20.May at 20:10
goto Postsql error:acces denied for user....(2)
 by nasbms
 on 19.May at 16:54
goto Postpemanggilan frame(4)
 by nasbms
 on 19.May at 16:14
goto Posttanya AvLock(0)
 by azuriza
 on 19.May at 11:24
goto PostGet TDBEdit Value Menggunakan LookUp Grid(10)
 by henry_sys
 on 18.May at 11:27
goto Postmenghitung record dalam perulangan(4)
 by idhiel
 on 16.May at 13:53
goto Posttanya ascii(4)
 by mas_kofa
 on 16.May at 12:11
goto PostRawPrint Untuk Delphi XE2(0)
 by adewijaya
 on 15.May at 22:34
goto Postdatabase error..(4)
 by idhiel
 on 15.May at 15:57
goto Postbekasi, pt arila putra mahkota(3)
 by mas_kofa
 on 15.May at 15:37
goto Postbagaimana cara membaca file *.doc dg delphi?(0)
 by ficky
 on 15.May at 06:14
goto Posttanya biner to matriks(13)
 by diandewi
 on 14.May at 20:30

..:: onLast Articles ::..
..:: New Download ::..
Pascal-id.Org
Feeds -  Popular -  Latest
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: Perkenalan dan Absen
8 months, 3 weeks ago
RE: Alhamdulillah Buka Puasa Bersama
8 months, 4 weeks ago
RE: تَقَبَّلَ اللهُ مِنَّا وَمِنْكَ - Selamat Hari Raya Idul Fitri
8 months, 4 weeks ago
Lintas Situs
«
free web site stats and visitor tracking

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
fongersOffline
Location:
25 Post subject: Convert Paradox --> Access ,,, Apa yang salah Ya???  PostPosted: 11/Dec/2010 13:18
onSkilled


Joined: 15-Dec-2007
Posts: 85

Status: Offline
Tema2 mohon bantuan nya
saya udah 2 hari ne ngotak atik kode ini tapi error mulu apa yang salah ya

Error Message := Snytax error in FROM clausa

code : pascal
  1. unit Unit1;
  2. interface
  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, StdCtrls, ADODB, DB, DBTables;
  6. type
  7. Tmainfrm = class(TForm)
  8. cbbox: TComboBox;
  9. mmo1: TMemo;
  10. btncreateCMD: TButton;
  11. btnsalindata: TButton;
  12. tblparadox: TTable;
  13. tblAdo: TADOTable;
  14. ADOcon1: TADOConnection;
  15. ADOcmd: TADOCommand;
  16. procedure FormCreate(Sender: TObject);
  17. procedure btncreateCMDClick(Sender: TObject);
  18. function AccessType(fd: TFieldDef): string;
  19. procedure btnsalindataClick(Sender: TObject);
  20. private
  21. { Private declarations }
  22. public
  23. { Public declarations }
  24. end;
  25. var
  26. mainfrm: Tmainfrm;
  27. implementation
  28. {$R *.dfm}
  29. //---- fungsi menterjemahkan datatype paradox---> access mins paradox: string-- access: text
  30. function Tmainfrm.AccessType(fd: TFieldDef): string;
  31. begin
  32. case fd.DataType of
  33. ftString: Result := 'TEXT(' inttostr(fd.Size) ')';
  34. ftSmallint: Result := 'SMALLINT';
  35. ftInteger: Result := 'INTEGER';
  36. ftWord: Result := 'WORD';
  37. ftBoolean: Result := ' YESNO';
  38. ftFloat: Result := 'FLOAT';
  39. ftCurrency: Result := ' CURRENCY';
  40. ftDate, ftTime, ftDateTime: Result := 'DATETIME';
  41. ftAutoInc: Result := 'COUNTER';
  42. ftBlob, ftGraphic: Result := 'LONGBINARY';
  43. ftMemo, ftFmtMemo: Result := 'MEMO';
  44. else
  45. Result := 'MEMO';
  46. end;
  47. end;
  48. procedure Tmainfrm.FormCreate(Sender: TObject);
  49. begin
  50. session.GetTableNames('dbdemos', '*.DB', False, False, cbbox.Items);
  51. end;
  52. procedure Tmainfrm.btncreateCMDClick(Sender: TObject);
  53. var
  54. i: Integer;
  55. s: string;
  56. begin
  57. tblparadox.TableName := cbbox.Text;
  58. tblparadox.FieldDefs.Update;
  59. s := 'CREATE TABLE' tblparadox.TableName '(';
  60. with tblparadox.FieldDefs do
  61. begin
  62. for i := 0 to Count - 1 do
  63. begin
  64. s := s '' items[i].Name;
  65. s := s '' AccessType(Items[i]);
  66. s := s ',';
  67. end;
  68. s[Length(s)] := ')';
  69. end;
  70. mmo1.Clear;
  71. mmo1.Lines.Add(s);
  72. end;
  73. procedure Tmainfrm.btnsalindataClick(Sender: TObject);
  74. var
  75. i: Integer;
  76. tblname: string;
  77. begin
  78. tblname := cbbox.Text;
  79. //----------------refresh
  80. btncreateCMDClick(Sender);
  81. // --------------drop tabel diperlukan jika tabel sudah ada dan di hapus , buang jika tabel belum ada
  82. ADOcmd.CommandText := 'DROP TABLE' tblname;
  83. ADOcmd.Execute;
  84. // ----------------------buat baru
  85. ADOcmd.CommandText := mmo1.Text;
  86. ADOcmd.Execute;
  87. tblAdo.TableName := tblname;
  88. // -----------------salin data
  89. tblparadox.Open; //---- buka tabel paradox
  90. tblAdo.Open; //------- buka tabel MSAccess
  91. try
  92. while not tblparadox.Eof do
  93. begin
  94. tblAdo.Insert;
  95. for i := 0 to tblparadox.Fields.Count - 1 do
  96. begin
  97. tblAdo.FieldByName(tblparadox.FieldDefs[i].Name).Value :=
  98. tblparadox.Fields[i].Value;
  99. end;
  100. tblAdo.Post;
  101. tblparadox.Next;
  102. end;
  103. finally
  104. tblparadox.Close;
  105. tblAdo.Close;
  106. end;
  107. end;
  108. end.
Parsed in 0.022 seconds, using GeSHi
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic





Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits


| Register | Lost Password ? |