Page 1 of 1

UniDac in WebModule

Posted: Thu 08 May 2014 06:34
by mika
Hi,
I'm evaluating unidac (odbc connection to Pervasive SQL) in XE5
I try to build webserverapplication as standalone VCL appliction and have simple WebModule.
Server and queries work fine at runtime, but when closing server application I get AV in TCriticalSection.Acruire.
Here is simplified code, which causes error.
procedure TWebModule1.WebModule1WebActionItem2Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
I: Integer;
uc : TUniConnection;
uq : TUniQuery;
begin
uc := TUniConnection.Create(nil);
with uc do
begin
ProviderName := 'ODBC';
Server := 'OmaDb';
Connected := True;
LoginPrompt := False;
end;
uq := TUniQuery.Create(nil);
uq.Connection := uc;
uq.SQL.Text := 'select nimi, hinta from tuote where numero = :n';
begin
for I := 0 to request.QueryFields.Count-1 do
begin
uq.ParamByName('n').AsString :=request.QueryFields.strings;
uq.Open;
uq.Close;
end;
end;
response.ContentType := 'text/html';
response.Content := res;
uq.free;
uc.Disconnect;
uc.Free;
handled := true;
end;

I tested same code in normal VCL form event and didn't get any AV while closing app.

Re: UniDac in WebModule

Posted: Thu 08 May 2014 07:57
by mika
This error also happened on Pervasive's own TPvQuery, so problem might be something else

Re: UniDac in WebModule

Posted: Mon 12 May 2014 12:06
by AlexP
Hello,

The problem may be due to the ODBC driver. Please try to use another driver version.