Posted: Thu Dec 25, 2003 1:54 am Post subject: newbie on webbroker don't grasp it
Hi,
I ry to modify an example from Marco Canu a bit.
The example is called CustQueP, from Mastering delphi 6, chapter 22, page
970.
Made it a CGI-app. Works perfect.
Now I try to let it work with Interbase 6.0.1.6. The pageProducer refuse to
fill the comboboxes.
I tried with BDE (TDatabase) and dbExpress; both give the same problem.
Posted: Thu Dec 25, 2003 5:43 pm Post subject: Re: newbie on webbroker don't grasp it
"Alfred ten Hoeve" <nospam (AT) nospam (DOT) nl> wrote
Quote:
Now I try to let it work with Interbase 6.0.1.6. The pageProducer refuse
to
fill the comboboxes.
I tried with BDE (TDatabase) and dbExpress; both give the same problem.
I use IBX to connect to IB. However show us please a piece of your code to
see what's going on.
procedure TWebModule1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings; var ReplaceText: String);
begin
if TagString = 'script' then
ReplaceText := Request.InternalScriptName
else
begin
ReplaceText := '';
Query2.SQL.Clear;
Query2.SQL.Add ('select distinct ' +
TagString + ' from customer');
try
Query2.Open;
try
Query2.First;
while not Query2.EOF do
begin
ReplaceText := ReplaceText +
'<option>' + Query2.Fields[0].AsString +
'</option>'#13;
Query2.Next;
end;
finally
Query2.Close;
end;
except
ReplaceText := '{wrong field: ' + TagString + '}';
end;
end;
end;
If I link the Query to DBDemos, all works fine.
If I link the Query, via a TDatabase, to Mastsql.gdb in the "Borland
SharedData" directory it don't. I get the form, but the comboboxes are not
filled with data.
The same when I use dbExpress to get the info out of Mastsql.gdb.
Even if I don't use a Pageproducer, but write all HTML in code, same result.
So what is going wrong? I don't grasp it.
procedure TWebModule1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings; var ReplaceText: String);
begin
if TagString = 'script' then
ReplaceText := Request.InternalScriptName
else
begin
ReplaceText := '';
Query2.SQL.Clear;
Query2.SQL.Add ('select distinct ' +
TagString + ' from customer');
try
Query2.Open;
try
Query2.First;
while not Query2.EOF do
begin
ReplaceText := ReplaceText +
'
'</option>'#13;
Query2.Next;
end;
finally
Query2.Close;
end;
except
ReplaceText := '{wrong field: ' + TagString + '}';
end;
end;
end;
If I link the Query to DBDemos, all works fine.
If I link the Query, via a TDatabase, to Mastsql.gdb in the "Borland
SharedData" directory it don't. I get the form, but the comboboxes are
not
filled with data.
The same when I use dbExpress to get the info out of Mastsql.gdb.
Even if I don't use a Pageproducer, but write all HTML in code, same
result.
So what is going wrong? I don't grasp it.
I presume you have an active Transaction in your IB?
Chris
Sure.
BTW if I don't use the PageProducer and put all the (HTML)code in an
ActionHandler (still using the IB-query), the effect is the same. If I write
the Response.Content-string to a file (say Test.htm) and open the file in IE
the form is OK.
Posted: Fri Dec 26, 2003 5:56 am Post subject: Re: newbie on webbroker don't grasp it
BTW, is the IB database path fully qualified. ie say
someComputerName:c:somePathsomeDatabaseName.gdb?
Can't think why you couldn't get your SQL Query data unless your SQL
statement is not qualified correctly?
Chris
"Alfred ten Hoeve" <nospam (AT) nospam (DOT) nl> wrote
Quote:
"chrisC" <chris (AT) awesomesoft (DOT) com> schreef in bericht
news:3feb838e$1 (AT) newsgroups (DOT) borland.com...
I presume you have an active Transaction in your IB?
Chris
Sure.
BTW if I don't use the PageProducer and put all the (HTML)code in an
ActionHandler (still using the IB-query), the effect is the same. If I
write
the Response.Content-string to a file (say Test.htm) and open the file in
IE
the form is OK.
BTW, is the IB database path fully qualified. ie say
someComputerName:c:somePathsomeDatabaseName.gdb?
Can't think why you couldn't get your SQL Query data unless your SQL
statement is not qualified correctly?
Chris
Thanks Chris,
I had the database and IB-Server on the same disk as IIS, so I thought that
a local path (without ComputerName) was sufficient. Now I learned that the
connectionstring must contain the servername as well.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum