ODBC 
 Standard Security:"Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;"  Workgroup:"Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;SystemDB=C:\mydatabase.mdw;"  Exclusive:"Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Exclusive=1;Uid=admin;Pwd="  OLE DB, OleDbConnection (.NET) 
 Standard security:"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User Id=admin;Password=;"  Workgroup (system database):"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet OLEDB:System Database=system.mdw;"  With password:"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet OLEDB:Database Password=MyDbPassword;" 

解决方案 »

  1.   

    我在web.config文件里这样做的。     
      <appSettings key="Dsn"
    value="provder=Microsoft.Jet.Oledb.4.0; Data source=name.mdb">
    </appSettings>
    然后在vb文件中:
       Dim Strsql As string
      Dim strcon As string
      Dim Sqlcon As OledbConnection
      Dim Sqlcom As OledbCommand
      Dim showread As OledbDataReader
      strcon=ConfigurationAppSettings.Appsettings("Dsn")
         Sqlcon=New OledbConnection(strcon)可是提示我:
    编译错误 
    说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: BC30451: 名称“ConfigurationAppSettings”未声明。源错误: 行 42:   Dim Sqlcom As OledbCommand
    行 43:   Dim showread As OledbDataReader
    行 44:   strcon=ConfigurationAppSettings.Appsettings("Dsn")
    行 45:      Sqlcon=New OledbConnection(strcon)
    行 46:   Strsql="select title,bandlist,content,picurl,froms,addtime from [love] where classid="&request("classid")&" and id="&request("id")
     
      

  2.   

    <appSettings>
        <add key="sqlConn" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;" />
      </appSettings>
    读取是
    ConfigurationSettings.AppSettings("sqlConn").ToString
      

  3.   

    using System.Configuration;打开namespace,就可以正常运行了。
      

  4.   

    在web.config里怎么设置数据库的路径呀?!
      

  5.   

    修改add key 中的value就行了
    如把mydb.mdb改成othermydb.mdb:
    <add key="sqlConn"
     value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;" />
    改成
    <add key="sqlConn"
     value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\othermydb.mdb;" />
      

  6.   

    ConfigurationSettings.AppSettings("sqlConn")返回的是object
    要类型转换
      

  7.   

    <add key="sqlConn"
     value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;" />
    如何把\somepath\mydb.mdb表示成文档根目录下的.mdb