在Access中如何使用查询?
我想在我的所有信息中查询,日期中包含“2005”的相关记录的所有内容,怎么做?^_^,不知道我有没有说明白我用的是ACCESS2003版本,希望能说明的详细些....
我想在我的所有信息中查询,日期中包含“2005”的相关记录的所有内容,怎么做?
^_^,不知道我有没有说明白
我用的是ACCESS 2003版本,希望能说明的详细些. 展开
^_^,不知道我有没有说明白
我用的是ACCESS 2003版本,希望能说明的详细些. 展开
3个回答
展开全部
连接access数据库
asp数据库
一、
<%
dim conn
dim dbpath
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("8301.asp")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
%>
二、
<%
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("rc/lzh.asp")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}"
Conn.Open connstr
%>
dim ipconn
set ipconn=server.createobject("ADODB.CONNECTION")
ipconn.open "DBQ="&server.mappath("ip.mdb")&";DRIVER={Microsoft Access Driver (*.mdb)};"
dim rs,sql
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select top 1 ip_b,ip_c from ip where (ip_s<=" & ip & " and ip_e>=" & ip & ")"
rs.Open sql,ipconn,1,1
if rs.eof or rs.bof then
getaddress="未知|未知"
Else
getaddress=rs(0)&"|"&rs(1)
end if
mdb数据库
一、
<%dim coon
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("123456789/123.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}"
Conn.Open connstr
%>
二、
dim conn
set conn = server.createobject("adodb.connection")
conn.open = "provider=microsoft.jet.oledb.4.0;" & "data source = " & server.mappath("../db/bbs.mdb")
三、
<%@ language=VBs cript%>
<%
dim conn,mdbfile
mdbfile=server.mappath("数据库名称.mdb")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};uid=admin;pwd=数据库密码;dbq="&mdbfile
%>
set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION")
DBPath = Server.MapPath("customer.mdb")
dbconnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
SQL="select * from auth where id='" & user_id &"'"
SET uplist=dbconnection.EXECUTE(SQL)
2.
set dbconnection=Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("customer.mdb")
dbconnection.Open "provider=microsoft.jet.oledb.4.0;data source="&dbpath
SQL="select * from auth where id='" & user_id &"'"
SET uplist=dbconnection.EXECUTE(SQL)
3.
DBPath = Server.MapPath("customer.mdb")
set session("rs")=Server.CreateObject("ADODB.Recordset")
' rs=Server.CreateObject("ADODB.Recordset")
connstr="provider=microsoft.jet.oledb.4.0;data source="&dbpath
SQL="select * from auth where id='" & user_id &"'"
session("rs").Open sql,connstr,1,3
4.
建odbc源xxx
set conn=server.createobject("Adodb.connection")
conn.open "DSN=xxx;UID=;PWD=;Database=customer
SetConn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("aaa/bbspp1.mdb")+";DefaultDir=;
DRIVER={Microsoft AccessDriver(*.mdb)};DriverId=25;FIL=MSAccess;
ImplicitCommitSync=Yes;
MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;
Threads=3;UserCommitSync=Yes;"
Conn.Openconnstr
说明: 其中SetConn=Server.CreateObject("ADODB.Connection")为建立一个访问数据的对象, server.mappath(aaa/bbspp1.mdb)是告诉服务器access数据库访问的路径
conn.asp的内容如下:
<%
dim conn,rs
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("mdb/mfkiqpl.mdb ")
set rs=server.createobject("adodb.recordset")
set rs.activeconnection=conn
%>
asp数据库
一、
<%
dim conn
dim dbpath
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("8301.asp")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
%>
二、
<%
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("rc/lzh.asp")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}"
Conn.Open connstr
%>
dim ipconn
set ipconn=server.createobject("ADODB.CONNECTION")
ipconn.open "DBQ="&server.mappath("ip.mdb")&";DRIVER={Microsoft Access Driver (*.mdb)};"
dim rs,sql
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select top 1 ip_b,ip_c from ip where (ip_s<=" & ip & " and ip_e>=" & ip & ")"
rs.Open sql,ipconn,1,1
if rs.eof or rs.bof then
getaddress="未知|未知"
Else
getaddress=rs(0)&"|"&rs(1)
end if
mdb数据库
一、
<%dim coon
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("123456789/123.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}"
Conn.Open connstr
%>
二、
dim conn
set conn = server.createobject("adodb.connection")
conn.open = "provider=microsoft.jet.oledb.4.0;" & "data source = " & server.mappath("../db/bbs.mdb")
三、
<%@ language=VBs cript%>
<%
dim conn,mdbfile
mdbfile=server.mappath("数据库名称.mdb")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};uid=admin;pwd=数据库密码;dbq="&mdbfile
%>
set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION")
DBPath = Server.MapPath("customer.mdb")
dbconnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
SQL="select * from auth where id='" & user_id &"'"
SET uplist=dbconnection.EXECUTE(SQL)
2.
set dbconnection=Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("customer.mdb")
dbconnection.Open "provider=microsoft.jet.oledb.4.0;data source="&dbpath
SQL="select * from auth where id='" & user_id &"'"
SET uplist=dbconnection.EXECUTE(SQL)
3.
DBPath = Server.MapPath("customer.mdb")
set session("rs")=Server.CreateObject("ADODB.Recordset")
' rs=Server.CreateObject("ADODB.Recordset")
connstr="provider=microsoft.jet.oledb.4.0;data source="&dbpath
SQL="select * from auth where id='" & user_id &"'"
session("rs").Open sql,connstr,1,3
4.
建odbc源xxx
set conn=server.createobject("Adodb.connection")
conn.open "DSN=xxx;UID=;PWD=;Database=customer
SetConn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("aaa/bbspp1.mdb")+";DefaultDir=;
DRIVER={Microsoft AccessDriver(*.mdb)};DriverId=25;FIL=MSAccess;
ImplicitCommitSync=Yes;
MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;
Threads=3;UserCommitSync=Yes;"
Conn.Openconnstr
说明: 其中SetConn=Server.CreateObject("ADODB.Connection")为建立一个访问数据的对象, server.mappath(aaa/bbspp1.mdb)是告诉服务器access数据库访问的路径
conn.asp的内容如下:
<%
dim conn,rs
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("mdb/mfkiqpl.mdb ")
set rs=server.createobject("adodb.recordset")
set rs.activeconnection=conn
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2005-11-29
展开全部
select ... where 字段名 like '%2005%'
这样就可以了!
这样就可以了!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
qu
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询