´´½¨µÄ¹ý³ÌÖгöÏÖdatabase login¶Ô»°¿ò£¬ÇëÎÊÔõôÑù²»ÈøöԻ°¿ò³öÏÖ£¿ÁíÍâÈçºÎ¶¨ÒåÈÕÆÚÐÍÊý¾ÝΪ¶ÌÈÕÆÚÐÍ£¿ºÃÏñÖ»Äܶ¨ÒåΪDatetime¡£
Ô´ÂëÈçÏ£º
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
procedure Tfrmweihu.btncjsjkClick(Sender: TObject);
var
path,StrSQL:string;
CreateAccess: OleVariant;
ADOConn: TADOConnection;
const
AConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s';
begin
//´´½¨Êý¾Ý¿âÎļþ
Path := ExtractFilePath(Application.ExeName);
if FileExists(Path + 'mydata.mdb') then
begin
showmessage('Êý¾Ý¿âÎļþÒѾ´æÔÚ£¡');
exit;
end;
CreateAccess:=CreateOleObject('ADOX.Catalog');
CreateAccess.Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source= '+Path+'mydata.mdb');
//´´½¨Êý¾Ý±í
ADOConn:=TADOConnection.create(self);
ADOConn.ConnectionString:=Format(AConnectionString,[Path +'mydata.mdb','']);
Strsql := 'create table mydata (ID autoincrement PRIMARY KEY not null,±êÇ©1 char(50) not null,±êÇ©2 char(50),±êÇ©3 char(50),±êÇ©4 char(50),±êÇ©5 char(50),±êÇ©6 char(50),ÕýÎÄ1 text not null,ÕýÎÄ2 text,ÈÕÆÚ Datetime not null)';
ADOConn.Execute(strsql);
ADOConn.Close;
ADOConn.Free;
Showmessage('Êý¾Ý±í´´½¨³É¹¦,'+#13#10+'ÇëÖØÐÂÆô¶¯±¾³ÌÐò£¡');
Ïà¹ØÎÊ´ð£º
ϵͳÿÌì²úÉúÒ»¸öexcelÎļþ£¬¸ñʽÏàͬ£¬ÄÚÈÝÓÃÎļþÃû£¨ÓòúÉúµÄʱ¼äÃüÃû£©Çø·Ö¡£ÎÒ×öÁËÒ»¸öaccessÊý¾Ý¿â£¬µ¼ÈëexcelµÄÊý¾Ý£¬ÎÒÏë¼ÓÒ»Ïî¼Í¼ÎļþÃûÀ´Çø·ÖÄÚÈÝ£¬¿ÉÊÇÔõô×öÄØ£¿ÓÖ»òÕßÓÃʲôÆäËû·½·¨¿ÉÒÔ°ìµ½£¿Ð»ÁË
Äã ......
³õÓÃACCESSÊý¾Ý¿â£¬ÒªÊµÏÖÒ»¸ö¹ØÁª²éѯ£¬sqlÓï¾äÈçÏ£ºselect pid,product_Type.name as tid,name,img_url,context,remark from Product join product_Type on product.type_id = product_Type.type_id order by pid ......
ÔÚaccessÖÐÔõôִÐÐselect TOP (@size) * from table1
Õâ¸öTOPÔõô´ø²ÎÊý²éѯ°¡
ÓÃVBA¶¯Ì¬Éú³ÉSQLÓï¾ä£¬ÔÙÖ´ÐÐ
²»ÄÜÖ±½ÓÓÃSQLÓï¾ä£¬ÓÃ×Ö·û´®ÀÛ¼ÓÉú³ÉSQLÓï¾äµÄ·½·¨À´Ö´ÐÐSQLÓï¾ä
top n Õâ¸öûÓа취ʹÓò ......
´ÓÀàÐÍ"DBNULL" µ½ÀàÐÍ¡°Double¡±µÄת»»ÎÞЧ£¨Êý¾Ý¿âÖжÔÓ¦µÄ a3 »òa5 ûÓÐÊý¾ÝÊÇΪ¿Õ£©
,ÇëÎÊÎÒÔõô´¦Àí£¡
VB.NET code:
Dim a1 As String = Nothing
Dim a2 As S ......
sqlÓï¾ä£º
SELECT top 12 Forum.ID,Forum.topic,Reforum.id,Reforum.username,Reforum.posttime,Reforum.postip,Forum.username from Forum INNER JOIN Reforum ON Forum.ID = Reforum.topicid wher ......