怎么把adodc控件连接的数据库的路径设为当前文件夹下,而不是连接到绝对路径下?

解决方案 »

  1.   

    app.path & "\" & "db.mdb"
      

  2.   

    dim myDataFile as string
    if len(app.path)=3 then
      myDataFile = app.path & "db.mdb"
      else
      myDataFile = app.path & "\db.mdb"
    end if
      

  3.   

    app.path & "\" & "db.mdb"
    这样就能搞定了,呵呵,祝你成功
      

  4.   

    在adodc控件中怎么写呢?她的ConnectionString属性中不允许用app.path
      

  5.   

    Adodc1.ConnectionString = ".............Data Source=" & app.path & "\" & "x.mdb"
      

  6.   

    Private Sub Form_Load()
    Adoc1.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & app.path & "\" & "数据库名.mdb"
    End Sub
      

  7.   

    能用app.path啊, 怎么不能了,如下:adodc1.connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & app.path & "\data.mdb;Persist Security Info=False"