[unixODBC-dev] Re: Problem with threading/Asta - supplemental

David Keith dkeith at noThis.logisticshealth.spamremove.com
Mon Jul 26 20:47:09 BST 2004


David Keith wrote:
> David Keith wrote:
> 
>> I've put together an AstaIO daemon written in Kylix/Delphi that uses 
>> ODBC Express as it's vendor interface. I'm using FreeTDS to connect to 
>> SQL Server 2K.
>>
>> When you start the AstaIO daemon it normally creates about 19 
>> instances as checked by using ps -A|grep Asta.
>>
>> Because some results weren't coming back correctly in the ExecProc 
>> call I started futzing around with the Hdbc component. I set CursorLib 
>> from 'Use Driver' to 'Use ODBC'. When I did this and ran a test with 
>> the ODBC Express components, I got my result params. But when I tried 
>> to start the AstaIO daemon, only one instance showed up in the process 
>> list and the server was in a non-responsive state.
>>
>> In reading posts on this group I've seen that you can set a 
>> 'Threading' option in odbcinst.ini. I've tried '= 0' and '= 50' but 
>> that made no difference; with the ' = 50' option I get one 
>> non-functioning instance of my server, with ' = 0' I get no instances 
>> at all. I've also tried 'Pooling = Yes' and 'Pooling = No' but that 
>> seems to make no difference either.
>>
>> Thanks for any assistance.
>>
>> David Keith
>>
> Additional info:
> 
> HDBC -
> Connection Pooling = cpDefault
> CursorLib = Use Driver
> DataSource = <valid DSN>
> Driver = ''
> IsolationLevel = ReadCommitted
> 
> HSTMT -
> BindByName = True
> ConcurrencyType = Read Only
> CursorType = Dynamic
> 
> OEDataSet -
> StoredProc = <valid SP>
> 
> Whenever I call ExecSQL with the TOEDataSet with Params assigned and a 
> result param to be filled I get the following error:
> 
> Unable to Retrieve ODBC Error
> 
> Here's the code:
> 
> 
>   try
>     with oedsLogin do
>     begin
>       ParamByName('@CustCode').AsString := Customer;
>       ParamByName('@Username').AsString := User;
>       ParamByName('@Password').AsString := Pass;
>       LogMessage('ValidateLogin: ExecSQL','Runlog',True);
>       ExecSQL;
>       LogMessage('ValidateLogin: Result Assignment','Runlog',True);
>       Result := ParamByName('@IsValid').AsString;
>     end;
>   except
>     on E:Exception do
>       LogMessage('ValidateLogin: ' + E.Message,'Runlog',True);
>   end;
> 
> 
> David Keith
> 
Know how to read/interpret the sql.log file? Here's the Error code that 
I get after successfully executing a few MS SQL 2K Select stored 
procedures, and attempt to execute an Exec Procedure that returns a 
result param, giving me the dreaded 'Unable to retrieve ODBC Error':

[ODBC][31531][SQLExecute.c][186]
                 Entry:
                         Statement = 0x8412a80
[ODBC][31531][SQLExecute.c][341]
                 Exit:[SQL_ERROR]
[ODBC][31531][SQLGetDiagRec.c][710]
                 Entry:
                         Statement = 0x8412a80 

                         Rec Number = 1 

                         SQLState = 0x43ab5772 

                         Native = 0x43ab5874 

                         Message Text = 0x43ab5672 

                         Buffer Length = 256 

                         Text Len Ptr = 0x43ab5872
[ODBC][31531][SQLGetDiagRec.c][747]
                 Exit:[SQL_NO_DATA]





More information about the unixODBC-dev mailing list