"
开启己知文件类型的扩展名显示的方法是
打开我的电脑->工具菜单->
文件夹选项
菜单->查看
选项卡
->高级设置->去掉"隐藏己知文件类型的扩展名"
复选框
的选中->确定
再重命名
文件扩展名
为X.MDB
就OK了
分类: 电脑/网络 >>程序设计 >>其他编程语言解析:
连接access数据库
asp数据库
一、
<%
dim conn
dim dbpath
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("8301")
conn.Open "driver={Microsoft Access Driver (*.mdb)}dbq=" &DBPath
%>
二、
<%
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("rc/lzh")+"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("***********/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=adminpwd=数据库密码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.0data 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.0data 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=xxxUID=PWD=Database=customer
SetConn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("aaa/bbspp1.mdb")+"DefaultDir=
DRIVER={Microsoft AccessDriver(*.mdb)}DriverId=25FIL=MSAccess
ImplicitCommitSync=Yes
MaxBufferSize=512MaxScanRows=8PageTimeout=5SafeTransactions=0
Threads=3UserCommitSync=Yes"
Conn.Openconnstr
说明: 其中SetConn=Server.CreateObject("ADODB.Connection")为建立一个访问数据的对象, server.mappath(aaa/bbspp1.mdb)是告诉服务器access数据库访问的路径
conn的内容如下:
<%
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
%>
还不懂啊 加偶的QQ 直接问吧
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)