Add - Remove ODBC Data Source To MS SQL Server (SQLConfigDataSource)
Add - Remove ODBC Data Source To MS SQL Server (SQLConfigDataSource)
Hello.
I would like to add and rem ove ODBC data sour ces to a MS SQL
Ser ver fr om m y pr ogram . I have the following code that alm ost
does the tr ick.
<--Begin code-->
unit m ain;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Contr ols, Form s,
Dialogs,
StdCtrls;
const
ODBC_ADD_DSN = 1; / / Add data source
ODBC_CONFIG_DSN = 2; // ConÒgure (edit) data
ODBC_REMOVE_DSN = 3; // Rem ove data source
ODBC_ADD_SYS_DSN = 4; // add a system DSN
ODBC_CONFIG_SYS_DSN = 5; // ConÒgure a system DSN
ODBC_REMOVE_SYS_DSN = 6; // remove a system DSN
ODBC_REMOVE_DEFAULT_DSN = 7; // rem ove the default DSN
SQL_MAX_MESSAGE_LENGTH = 512;
type
TFor m1 = class(TFor m )
Button1: TButton;
Add/remove ODBC data source to MS SQL Server (SQLConfigDataSo... http://www.experts-exchange.com/Programming/Languages/Pascal/Delp..
Over 4 million
solutions, articles and videos
Browse Topics Join Today Login
Experts Exchange > Programming > Prog Languages > Pascal > Delphi > Add remove O D B C data source to M S S Q L Server S Q L Config
Data Source
var
Form 1: TFor m 1;
im plementation
{$R * .DFM}
Over 4 million
solutions, articles and videos
Browse Topics Join Today Login
Experts Exchange > Programming > Prog Languages > Pascal > Delphi > Add remove O D B C data source to M S S Q L Server S Q L Config
Data Source
eg:
// Add DSN
attr:='DSN=TEST'#0+
'Description=Test database'#0+
'SERVER=DBSERVER'# 0+
'DATABASE=Test'# 0+
'Trusted_Connection=No'#0+
'Uid=Apples'#0+
'Pwd=Oranges'# 0+
# 0;