½â¾öaccess¼¶Áª¸üÐÂÎÊÌâ - ÆäËûÊý¾Ý¿â¿ª·¢ / Access
CREATE TABLE Product(model integer,
maker varchar(20),
CONSTRAINT SAND PRIMARY KEY (model),
CONSTRAINT PANDA FOREIGN KEY (model) REFERENCES PC (model)
ON DELETE CASCADE ON UPDATE CASCADE)
·¢ÉúÔ¼Êø´íÎó
µ«ÊÇ
CREATE TABLE Product(model integer,
maker varchar(20),
CONSTRAINT SAND PRIMARY KEY (model), CONSTRAINT PANDA FOREIGN KEY (model) REFERENCES PC (model)£©¿ÉÒÔÔËÐÐ
ÔËÐл·¾³£ºsun.jdbc.odbc.JdbcOdbcDriver"
Çë¸ßÈËÖ¸½Ì~½â¾öaccess¼¶Áª¸üÐÂÎÊÌâ
ÄãµÄPC±íÖÐ model ÊDz»ÊÇÖ÷¼ü»òË÷Òý£¿
String queryx="create table PC(model integer, speed integer, ram integer, hd integer, price integer,CONSTRAINT CHINA PRIMARY KEY (model))";
String query="CREATE TABLE Product(model integer, maker varchar(20), CONSTRAINT SAND PRIMARY KEY (model), CONSTRAINT PANDA FOREIGN KEY (model) REFERENCES PC (model) ON DELETE CASCADE ON UPDATE CASCADE)";
s.executeUpdate(queryx);
s.executeUpdate(query);
ÎÊÌâÔÚÓÚON DELETE CASCADE ON UPDATE CASCADE¡£ºÃÏñ²»ÄÜÕâÑùд~ËÓоÑé½â¾öÒ»ÏÂ~
s¾ßÌåÄÚÈÝÊ¡ÂÔ..
ÄãÊÇͨ¹ýODBCÁ¬½ÓMDBµÄ£¿
Ïà¹ØÎÊ´ð£º
ACCESSÊý¾Ý¿âÖÐÓÐÒ»¸ötablename±í£¬Éè¼ÆÈçÏÂ
±àºÅ,ÊéÃû,×÷Õß,³ö°æʱ¼ä,³ö°æÉç,ISBN,Ŀ¼,¼ò½é
ÆäÖгý¡°±àºÅ¡±Îª×Ô¶¯±àºÅÍ⣬ÆäËü¶¼Îª¡°±¸×¢¡±
ÆäÖÐ"±àºÅ"άһ£¬ÔÚ¡°ISBN¡±ÖÐÓеÄΪ¿ÕÖµ£¬ ......
DbgridÁ¬½Óaccess ÏÔʾÊý¾ÝʱÍ϶¯¹ö¶¯ÌõËÀ»ú£¿Ôõô½â¾ö°¡£¿
»úÆ÷Ì«²îÁË°É£¿
ÊDz»ÊÇÄãÊý¾ÝÁ¿Ì«´óÁË°¡
ÄãÊý¾ÝÉÙһЩ¿´¿´»¹ËÀ»úÂð£¿
Êý¾ÝºÜÉÙ°¡ ¾ÍÒ»Ò³¡£
ÎÒÔÚBCB6ÏÂ×ö¹ý²»ÉÙ DBGRID+ACCESS £¬´ÓÀ´Ã»ÓÐÓöµ½ ......
ÔÚMSSQLÖУ¬ÎÒÃÇ¿ÉÒÔÒ»´Î²éѯ¶à¸öÊý¾Ý±í²¢¼ÓÈëµ½Êý¾Ý¼¯ÖУ¬ÖмäÖ»ÐèÓ÷ֺŸô¿ª£®È磺
£¢select * from A;select * from B;select * from C£¢,Ìî³äÊý¾Ý¼¯ºóÔÚDSÖоÍÓÐÁËÈýÕÅ±í£®
µ«ÔÚÓÃͬÑùµÄÓï¾ä·ÃÎÊACCESSÊý¾ ......
¸÷λ´óϺ£¬Ð¡µÜÓõÄÊÇADOÁ¬½ÓACCESSÊý¾Ý¿â£¬ÓÃDBGridÏÔʾ²éѯµÄÊý¾Ý£¬ÎÒ×öµÄÊǸöÊý¾Ý²É¼¯ÏµÍ³£¬¸ù¾Ý²»Í¬µÄµØÖ·°ÑÊý¾Ý·ÅÔÚACCESSÊý¾Ý¿âÖв»Í¬µÄ±íÀïÃ棬ÏÖÔÚÎÒÏë²éѯijһ¶Îʱ¼äÄÚËùÓбíÄÚµÄÊý¾Ý£¬²¢ÇÒÔÚDBGridÖÐÏÔʾ³ ......
ÎÒÔÚCBÁ·´´½¨ACCESSÎļþ£¬
²ÉÓõÄÏÂÁдúÂë,ÎÒרÃÅÏÈ×ö¸öС³ÌÐò²âÊÔ£¬Ò»ÇÐÕý³£¡£
È»ºóÔÚ¼ÓÔص½1¸öÈí¼þÖУ¬
´«ÈëµÄ±äÁ¿MDB_PathNameÒ²ÊÇÕýÈ·µÄ¡£
µ«ÔÚÖ´ÐÐ
mdb.OleFunction("Create", ......