Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
输入我的连接名称,我会看到类似DBQ=Path\to\DB. 如何检索此值?我试过了
DBQ=Path\to\DB
conn$DBQ
conn[DBQ]
conn['DBQ']
conn[,'DBQ']
无返回值。我试过typeof(conn)了"integer",class(conn)-> "RODBC",mode(conn)-> "numeric"。
typeof(conn)
"integer"
class(conn)
"RODBC"
mode(conn)
"numeric"
我认为没有简单的方法。您可以通过获取连接字符串attr(conn, "connection.string")然后尝试解析它(例如:sub("^DBQ=([^=]*);.*", "\\1", attr(a,"connection.string"))或strsplit(attr(a,"connection.string"),";")[[1]][1])。
attr(conn, "connection.string")
sub("^DBQ=([^=]*);.*", "\\1", attr(a,"connection.string"))
strsplit(attr(a,"connection.string"),";")[[1]][1]