Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > VCL

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 06-27-2012, 01:18 AM
dp_burtol dp_burtol is offline
Junior Member
 
Join Date: May 2010
Posts: 14
Default Please Help in MySql Views..

In MySql Views Query:
Select depotcode, depotname, employee_id From depot_profile Where employee_id=(VarEmployeeId)

This is what I want to do:
I want to pass a parameter from Delphi 2006 to supply the VarEmployeeID in my MysqlViews query. How will I do that Sir and Mam?

Note: to connect to the server I used Zeos components.
Reply With Quote
  #2  
Old 07-05-2012, 11:52 PM
major major is offline
Member
 
Join Date: Jun 2011
Posts: 42
Default

Drop a TZQuery on your form (and a TDataSource component if you are going to connect the database fields to data aware components - such as DBGrid or DBEdit)

Set the Connection property to your ZConnection (assumed to be properly configured and set to connected)

Code:
ZQuery1.SQL.Text := 'Select depotcode, depotname, employee_id From depot_profile Where employee_id= :ParamEmpID';
ZQuery1.ParamByName('ParamEmpID').AsInteger := <EmpIDValue>;
ZQuery1.Open;
Obviously change <EmpIDValue> with the actual value you want to select on.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:06 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.