Question related to an earlier asked question (Python - how to read path file/folder from server). I have similar issue- I am using python and used f=open('\\SERVER\share\file.ext', 'r')
to open/access folder in a remote server- but its still giving me an error "no such file directory" can you please help me with that.
What I am trying to do is to goto my remote server and read that particular file and upload on my sql database. I am using pyodbc and connection to db is fine, I can query select and even insert individual values in table. But I want to do either a load data local infile query or insert as a loop around my csv file. this is what i have
dsn=name; pw=password
def func(dsn):
connection = pyodbc.connect(dsn)
connection.autocommit =True
cur = connection.cursor()
csv_data = open (r'\\server-ipaddress\C:\foldername\filename.csv','r')
for row in csv_data:
cur.execute("insert into table_name values(?)",row)