惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - Hm

敏捷开发中asp.net mvc3编写的正确顺序 WF4.0入门系列2——用代码创建一个简单的工作流 WF4.0入门系列 WF4.0入门系列1——创建一个简单的工作流 C#解析xml代码 - Hm - 博客园 什么是依赖注入 找不到可安装的ISAM错误 - Hm - 博客园 使vs2008支持extjs智能提示功能 VS2005文件自动定位功能 微软VSTS 2005 试用版注册为正式版的方法 敏捷开发感悟 敏捷开发笔记(二) 敏捷开发笔记(一) VS 2008 and .NET 3.5 Beta 2 发布了 得到本机的IP地址和MAC地址的工具类 动态权限树控件 DWR简介 WebWork Processors Then and Now
ASP.NET下用相对路径访问ACCESS数据解决方案
Hm · 2009-03-27 · via 博客园 - Hm

目前网上流行的方法主要有两种:

  第一种是通过使用 DataDirectory 目录的方法,但是 Access 文件必须放在 ASP.NET 的特殊目录中,如 App_Data ;

<addname="access"connectionString="Provider=Microsoft.Jet.Oledb.4.0;
cs.Phontol.comdatasource=|DataDirectory|mydb.mdb"/>

    另外一种方法是:在 web.config 文件中保存两个字符串,一个是驱动字符串,另一个是 access 文件的相对路径;

  使用时用 Server.MapPath 来获取绝对路径然后组合出来的连接字符串就可以使用了;

 <addname="access"connectionString="Provider=Microsoft.Jet.Oledb.4.0;datasource="/>
<addname="accessfile"connectionString="~/App_Data/mydb.mdb"/>