dim conn dim connstr dim db dim dbpaswd (Õâ¸öÃÜÂë¼ÓÔÚÄÄ) db=dbpath&"/"&dbname connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION") on error resume next conn.open connstr if err then Err.Clear Call CloseConn() Response.Write "Êý¾Ý¿âÁ¬½Ó³ö´í£¬Çë¼ì²éÊý¾Ý¿âĿ¼ºÍÊý¾Ý¿âÎļþÃûÊÇ·ñÕýÈ·¡£" Response.End end ifconnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=xxx;" Õâ¸öд·¨ÎÒ»¹ÓÃÄã½²Â𠣿 ÕâôţX£¬ÄÇÄ㻹ÊÇ×Ô¼ºÂýÂý¸ã°É£¡ VBScript code:
Access 97/2000/XP/2003 Database Connection String using Microsoft Access Driver (DSN less)
<%@LANGUAGE=VBSCRIPT%> <% Option Explicit Dim strConnection, conn, rs, strSQL
ÎÒÒª´ÓACCESS²éѯһÐÐÊý¾Ý,Êý¾Ý¿âÀïÓÐ ip£º192.168.2.71£¬192.168.2.55 SELECT COUNT(*) AS num from TreeNode WHERE ([ip]='192.168.2.55')£¬ÄÜÑ¡³öÊý¾ÝÀ´ SELECT COUNT(*) AS num from TreeNode WHE ......