我对python很陌生,想使用pyodbc将一个表从一个mdb复制到另一个mdb。如果文件夹名称以数字开头,则路径似乎存在问题。我现在google了一个小时,找不到解决方案:
DBfile = r"W:\path\1020 Folder\MDB1.mdb"
conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+DBfile1)
cursor = conn.cursor()
sql = """SELECT Table1.* INTO test FROM [W:\path\A 1020 Folder\MB2.mdb].Table1;"""
sql1 = """SELECT Table1.* INTO test FROM [W:\path\1020 Folder\MB2.mdb].Table1;"""
cursor.execute(sql) #WORKING
cursor.execute(sql1) #NOT WORKING
conn.commit()
非常感谢,阿奇姆