C#ÖÐÁ¬½Ó¼°²éѯAccess³öÏÖµÄÎÊÌâ
´óÏÀÃÇ£º
ÕâÊÇÎÒÁ¬½ÓÊý¾Ý¿âµÄ´úÂë
string strPath = Application.StartupPath + "\\Database.accdb";
string ConStr = "provider=Microsoft.jet.oledb.4.0;Data source=" + strPath;
OleDbConnection Olecon = new OleDbConnection(ConStr);
Olecon.Open();
string sql = "Select * from ѧÉúÐÅÏ¢ where ѧºÅ= '" + textBox1.Text.Trim() + "' ";
OleDbDataAdapter da = new OleDbDataAdapter(sql, Olecon);
DataSet ds = new DataSet();
da.Fill(ds, "ѧÉúÐÅÏ¢");
this.dataGridView1.DataSource = ds.Tables[0];
±¨´í£º
{"ÕÒ²»µ½Îļþ 'E:\\Êý¾Ý¿â»ù±¾²Ù×÷\\Êý¾Ý¿â»ù±¾²Ù×÷\\bin\\Debug\\Database.accdb'¡£"}
ʲôÔÒòÄØ¡¡
C# code:
@'E:\Êý¾Ý¿â»ù±¾²Ù×÷\Êý¾Ý¿â»ù±¾²Ù×÷\bin\Debug\Database.accdb'
??
ÄDz»ÊÇ˵ÁËÂð ÕÒ²»µ½Îļþ ÄãÄǸö·¾¶ÏÂÓÐÕâ¸öÎļþÂð£¿
C# code
Code highlighting produced by
Ïà¹ØÎÊ´ð£º
ÎÒÓÃAccessÊý¾Ý¿â×öÁËÒ»¸öͼÊéÊý¾Ý¿â£¬ÀïÃæÓÐÒ»¸ö×Ö¶ÎÊÇISBN£¬¾ÍÊÇISBNºÅ£¬µ«ÊÇÖ»µÄÒ»×Ü·ÖͼÊéдµÄISBNºÅ£¬ÓеÄûд£¬Ð´µÄÄÇÒ»²¿·ÖÓеÄISBNÊÇÖظ´µÄ£¬ÄÜ·ñÓÃSQLÓïÑÔ°ÑÖظ´µÄ¹ýÂ˵ô£¬µ«Ã»Ð´ISBNºÅµÄͼÊé²»ÄܹýÂ˵ô£¬È ......
ÄÄÀï³ö´íÁË£¬Êä³öÕâÑùµÄ½á¹û£¿£¿
<%@ Page Language="VB" AutoEventWireup="false" aspcompat="true" CodeFile="Default.aspx.vb" Inherits="_Default" %&g ......
accessÊý¾Ý¿â£¬Ö±½ÓʹÓà select ×ֶΠfrom ±í ¶ÁÈ¡Êý¾Ý
È»ºóÔÚÒ³ÃæÖÐʹÓÃRepeaterÀ´ÏÔʾ
ÕâÕűíÓÐ2000ÌõÊý¾Ý£¬ËùÒÔÒ³Ãæ´ò¿ªµÄºÜÂý
Çë½Ì¸÷λÅóÓÑ£¬ÓÐûÓа취½â¾ö£¬Ìá¸ßµãËٶȣ¡
Ò»´ÎÈ«²¿¶ÁÍê ......
ËüµÄ¶¨ÒåÊÇÕâÑùµÄ
_CRTIMP __checkReturn int __cdecl _access(__in_z const char * _Filename, __in int _AccessMode);
´ó¸ç£¬¿´¸öº¯ÊýÉùÃ÷¾ÍÄÜ¿´³öËû¸ÉɶµÄ£¿
´ÓÃüÃûÀ´¿´Ó¦¸ÃÊÇÅж ......
Âé·³¸÷λ°ïæ¿´¿´°¡
´úÂëÈçÏ£º
CoInitialize(NULL);
_ConnectionPtr pConn(__uuidof(Connection));
_RecordsetPtr pRst(__uuidof(Recordset));
pConn->ConnectionString="Provider ......