PowerBuilder Connect SQLServer Using ADO.Net
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | String ls_database, ls_servername, ls_port, ls_user, ls_pass ls_user = "User" ls_pass = "Password" ls_database = "database" ls_servername = "servername.com" ls_port = "port" Transaction ltran_conn ltran_conn = Create Transaction Disconnect Using ltran_conn ; // Using OLE DB Connect To SQLServer ltran_conn.DBMS = "ADO.Net" ltran_conn.LogId = ls_user ltran_conn.LogPass = ls_pass ltran_conn.AutoCommit = False ltran_conn.DBParm = "Namespace='System.Data.OleDb',Provider='SQLOLEDB',DataSource='"+ls_servername+","+ls_port+"',PROVIDERSTRING='Database='"+ls_database+"''" Connect Using ltran_conn ; If ltran_conn.SQLCode = -1 Then MessageBox('Warning','Connect Database Error' + ltran_conn.SQLErrText) //HALT CLOSE Else MessageBox('Warning',"Connect Success!") End If Disconnect Using ltran_conn ; |
Find Projects On Github click here
Good Luck!