Anda di halaman 1dari 2

SQLLink

Setting up the DSN. The first step is to configure the Data Source (ODBC). This is located in the Control Panel->Performance and Maintenance->Administrative Tools->Data Sources (ODBC) In User DSN select Add.. then The Driver from the list that applies to your chosen Database Application. Enter a Data Source Name by which you will connect to the selected database. (This is referred to as the DSN). Next, click on the Select Button and select your database file.

Using SQLLink.exe Syntax: SQLLink.exe DSN SQL_Statement [Login] [Password] Where: DSN is the Data Source Name configured as above. SQL_Statement is the statement to be executed. This must be in a form recognised by your Database driver. [Login] is an optional login should your database require a login. [Password] is optional should your database require a login and password. Return values: SQLLink.exe will return either Okay if the statement executed correctly otherwise Error These values are returned in a system variable named %Result%. The number of rows affected by the instruction is returned in the variable %Rowcount%. The information contained in this variable is dependant on the ODBC driver. In the event of a SELECT statement being sent, the column names will be returned with their associated values. (If the wildcard (*) character is used for the column names then all columns will be returned. Eg. SELECT Column1 Column2 FROM MyTable Will return the respective values as %Column1% and %Column2% Column values containing NULL will be returned as 0 (zero).

Anda mungkin juga menyukai