Python Forum
Sample code to connect DB using parameter values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sample code to connect DB using parameter values
#1
Need a sample program to connect SQL SERVER DB using parameter file


1) looking for sample code for connecting to DB using parameter file
Reply
#2
which DBMS?
Reply
#3
SQL SERVER, Sorry for late response

These are the parameters i want to call from a file into the program.

sourceDBDriver
sourceDBBserver
sourceDatabase
userid
password

and i am connecting this way

connect_String = 'Driver={%s}.....................
conn = pyodbc.connect(connect_string)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 11,062 Dec-26-2022, 08:48 AM
Last Post: ibreeden
  autocomplete working code sample not working... aviper4u 0 1,642 Oct-24-2020, 03:04 AM
Last Post: aviper4u
  Syntax error in python code sample ErnestTBass 5 3,122 Aug-14-2020, 07:14 PM
Last Post: deanhystad
  Hi Guys, please help me to write SAS macro parameter equivalent code in Python Manohar9589 2 2,602 Jun-14-2020, 05:07 PM
Last Post: Larz60+
  How to pass multiple values from one sample to nc variable? Baloch 0 1,869 Jun-01-2020, 09:27 PM
Last Post: Baloch
  Can anyone Please help on fixing this python code to connect and save things on sqlit Roscoes 2 2,915 Mar-06-2018, 04:48 AM
Last Post: Roscoes
  Unable to connect oracle database using python code mayuresh 2 17,101 Jan-27-2018, 11:57 AM
Last Post: mayuresh
  SoX Sound Exchange sample code to Rec & Play audio file Fran_3 3 6,567 Sep-11-2017, 09:13 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020