Example: lr_db_connect

In the following example, lr_db_connect connects to an Inventory SQL database using Oracle.

lr_db_connect("StepName=Connect", "ConnectionString=Provider=OraOLEDB.Oracle.1,
	Data Source=<Paste the Net service name from the clipboard here>; Persist Security Info=True;
       User ID=myUser;Password=myPassword", "ConnectionName=db1", "ConnectionType=OLEDB", LAST );

In the following example, lr_db_connect connects to an Inventory SQL database using SQL authentication.

lr_db_connect("StepName=DatabaseConnection", 
        "ConnectionString=Data Source=myServer.myLab.ad;Initial Catalog=InvDatabase;Persist Security Info=True;User ID=myUser;Password=myPassword",
        "ConnectionName=InvDatabaseConnection",
        "ConnectionType=SQL",
        LAST );

In the following example, lr_db_connect connects to an Inventory SQL database using Windows authentication. Note the additional Integrated Security argument that must be specified.

lr_db_connect("StepName=Connect", 
        "ConnectionString=Data Source=myServer\\mySoa;Integrated Security=SSPI;Password=password;User ID=DOMAIN\\UserName;Initial Catalog=soa;",         "ConnectionName=db1",
        "ConnectionType=SQL",
        LAST );