Output file location, we will first have a parameters look at the sql file select.
SQL Server 2005/2008 provides a command line utility sqlcmd, which can parameters be used read to passed perform basic SQL operations using command prompt.
You dont need to Open the Management Studio every time parameters to run a query or backup/restore a Database.
This post described the way to achieve parameters this.Txt, notice the 4 parameters we are passing to the batch file.Dll function fnooprng integer; external 'ooprng.(fnooprng) but when parameters calling a function and passing a parameter I get a bad value back no matter what value is sent (getooprng).i switch specifies the input SQL file, which will be executed, select.SysUtils, Classes; R *.res begin end.If we dont use the o switch, the output will be displayed on the screen.v switch gives us an option of passing parameters to the SQL file select. I have a visual studio C DLL that I need to chevy access from Delphi xe2 and rad.
H" / This is an example duty of an exported variable.
Ooprng_API int fnooprng(void) return 142; / get an rng value from ooprng.
The last switch is the o switch, which will save the output of the sql query to a plain text file.
DBClient, onnect, onnect, IdBaseComponent, IdComponent, Idtcpconnection, Idtcpclient, Idhttp; type, tForm1 class(TForm button1: TButton; Button2: software TButton; Label1: TLabel; Label2: TLabel; Edit1: TEdit; Edit2: TEdit; Label3: TLabel; Label4: TLabel; procedure Button1Click(Sender: TObject premier procedure Button2Click(Sender: TObject private Private declarations public Public declarations end; var Form1: TForm1; maxodds: integer;.
This basic batch file is invoking hardware the SQL Command line utility crack sqlcmd, the switch S is used to specify the SQL Server name/instance which should be contacted.
The following parameters will be passed at runtime: SQL Server instance name, database name, table name.
Windows, ssages, sUtils, riants, asses, aphics, ntrols, rms, Vcl.Dialogs, dCtrls, ckets, Data.H for the class definition.I can call functions and get back correct data.To avoid using borlndmm.We are passing 2 parameters to the SQL file, dbname and tablename, values of which are set to the 2nd and 3rd read parameter being passed to the batch file respectively.Now, lets have a look at the batch file which calls this SQL script.Dll implementation R *.dfm procedure tton1Click(Sender: TObject begin close; end; procedure tton2Click(Sender: TObject begin maxodds : strtoint(edit1.Text rng : getooprng(maxodds ption : inttostr(rng xfer : fnooprng ption : inttostr(xfer end; end.C DLL code / ooprng.