Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > General > Suggestion Box
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

Suggestion Box Let us hear about how you would like things to run here at Delphi-PHP.Net, if you have a comment or suggestion, post it here.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 26th April 2009, 08:00
Vishal's Avatar
just Joined!
 
Join Date: Apr 2009
Posts: 4
Vishal is on a distinguished road
Question Problem while executing ADO query

Hi,

I am using ADO connection component and ADO Query component to connect to Firebird Database. I have installed Firebird ODBC driver also.

I have following code, can anybody suggest me what exactly i am missing.

I am new for PHP, but using Delphi from long time.

code is very simple.

Idea behind this code is that to return an employee name as a result from a database.

As a result i am getting nothing.

What could be the problem and what is needed to get the empname as a result.

Thanks in advance.

************************************************** *******


unit Unit1;

interface

uses
Windows,
Messages,
SysUtils,
Classes,
Forms,
zendTypes,
zendAPI,
phpTypes,
phpAPI,
phpFunctions,
PHPModules,
IBODataset,

StdCtrls,
ADODB,
DB, ActiveX;

type

TPHPExtension1 = class(TPHPExtension)
procedure PHPExtension1Functions0Execute(Sender: TObject;
Parameters: TFunctionParams; var ReturnValue: Variant;
ZendVar: TZendVariable; TSRMLS_DC: Pointer);
private
{ Private declarations }
public
{ Public declarations }

end;

var
PHPExtension1: TPHPExtension1;

implementation

{$R *.DFM}


procedure TPHPExtension1.PHPExtension1Functions0Execute(Send er: TObject;
Parameters: TFunctionParams; var ReturnValue: Variant;
ZendVar: TZendVariable; TSRMLS_DC: Pointer);
var
DataBaseADOConnection: TADOConnection;
DataBaseQuery1: TADOQuery;
DataBaseQuery2: TADOQuery;
DataBasedataSource1: TDataSource;

begin
CoInitialize(nil);
DataBaseADOConnection := TADOConnection.Create(Self);


DataBaseADOConnection.ConnectionString := 'Provider=MSDASQL.1;Persist Security Info=False;User ID=sysdba;Data Source=C_PSTC';

DataBaseADOConnection.LoginPrompt := False;

DataBaseQuery1 := TADOQuery.Create(Self);

DataBaseQuery1.Active := False;
DataBaseQuery1.Connection := DataBaseADOConnection;
DataBaseQuery1.SQL.Clear;
DataBaseQuery1.SQL.Add('select empname from employeemaster');

DataBaseQuery1.Active := True;
couninitialize();
ReturnValue := DataBaseQuery1.FieldByName('empname').AsString;
end;

end.
************************************************** *******
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 26th April 2009, 23:38
delphi-php's Avatar
Forum Admin
 
Join Date: Mar 2007
Location: London, UK
Posts: 599
delphi-php has a reputation beyond reputedelphi-php has a reputation beyond reputedelphi-php has a reputation beyond reputedelphi-php has a reputation beyond reputedelphi-php has a reputation beyond reputedelphi-php has a reputation beyond reputedelphi-php has a reputation beyond reputedelphi-php has a reputation beyond reputedelphi-php has a reputation beyond reputedelphi-php has a reputation beyond reputedelphi-php has a reputation beyond repute
Default

Hi,

You might want to post this to the Database Integration forum

Cheers ....
Gerald.
__________________
Don't forget to add to a users reputation if they have helped you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 23:57.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use