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

推荐订阅源

Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
P
Proofpoint News Feed
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
F
Fortinet All Blogs
S
Schneier on Security
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
I
InfoQ
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
Stack Overflow Blog
Stack Overflow Blog
T
Troy Hunt's Blog
人人都是产品经理
人人都是产品经理
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
Forbes - Security
Forbes - Security
Vercel News
Vercel News
S
Security Affairs
美团技术团队
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
IT之家
IT之家
U
Unit 42
Recorded Future
Recorded Future
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
P
Palo Alto Networks Blog
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 【当耐特】

博客园 - 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"/>