Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE DATABASE IF NOT EXISTS `network` /*!40100 DEFAULT CHARACTER SET latin1 */;
- USE `network`;
- import pyodbc
- def connectToDB():
- connection = None
- while connection is None:
- try:
- connection = pyodbc.connect('DSN=data')
- except:
- print ("n[DB connector] Error connecting to database. Trying again in 1 sec.")
- time.sleep(1)
- return connection
Add Comment
Please, Sign In to add comment