Board index » delphi » Native Call To Sybase

Native Call To Sybase

I have been trying (in vain) to make a native call through the BDE to Sybase.  
Using the DBiGetProp function, this seems like it should be simple, but I must
be missing something obvious.

Does anyone have a (working) code snippet out there that they would be willing
to share (Delphi 1 or 2)?

Here are the basics of what I am doing.

In the interfaces section:

type
  DBPROCESS = Pointer;

var
  DBProc: DBPROCESS;
  SizeDBProc: word;

In the implementation part of the program:

DBiGetProp(hDBiObj(Database1.Handle), dbNATIVEHNDL,
  DBProc, SizeOf(DBProc), SizeDBProc);

Basically, DBProc does not end up with anything meaningful in it (usually nil
in the watch list).  I have used other types of calls to the DBiGetProp
function such as dbSERVERVERSION and dbProcedures and get meaningful results
so I know that the (hDBiObj(Database1.Handle) is a good value.

If I understand the native handle, the BDE has this in memory somewhere and
what I want is a pointer to it so I do not need to allocate memory for the
Pointer DBProc.

Help?!

--
Bob McClintock

 

Re:Native Call To Sybase


We havent managed this either but for most things we have found a way of
acheiving the result in a different way
what is it that youre trying to do .

Bob McClintock <rmccl...@ix.netcom.com> wrote in article
<5eva8m$...@sjx-ixn7.ix.netcom.com>...

Quote
> I have been trying (in vain) to make a native call through the BDE to
Sybase.  
> Using the DBiGetProp function, this seems like it should be simple, but I
must
> be missing something obvious.

> Does anyone have a (working) code snippet out there that they would be
willing
> to share (Delphi 1 or 2)?

> Here are the basics of what I am doing.

> In the interfaces section:

> type
>   DBPROCESS = Pointer;

> var
>   DBProc: DBPROCESS;
>   SizeDBProc: word;

> In the implementation part of the program:

> DBiGetProp(hDBiObj(Database1.Handle), dbNATIVEHNDL,
>   DBProc, SizeOf(DBProc), SizeDBProc);

> Basically, DBProc does not end up with anything meaningful in it (usually
nil
> in the watch list).  I have used other types of calls to the DBiGetProp
> function such as dbSERVERVERSION and dbProcedures and get meaningful
results
> so I know that the (hDBiObj(Database1.Handle) is a good value.

> If I understand the native handle, the BDE has this in memory somewhere
and
> what I want is a pointer to it so I do not need to allocate memory for
the
> Pointer DBProc.

> Help?!

> --
> Bob McClintock

Re:Native Call To Sybase


I do not have a do or die need for this, but wanted to experiment with some
direct calls.  I wanted to look at retrieving multple result sets from a
stored procedure for example.  The method for acquiring the handle looks
simple.  There is even a code snippet in Ken Henderson's Database Developer's
Guide with Delphi 2 which I have tried (without luck).

In article <01bc23ce$6b6b23b0$912470c2@ws037591>, "Nick Mappin"

Quote
<map...@dircon.co.uk> wrote:
>We havent managed this either but for most things we have found a way of
>acheiving the result in a different way
>what is it that youre trying to do .

>Bob McClintock <rmccl...@ix.netcom.com> wrote in article
><5eva8m$...@sjx-ixn7.ix.netcom.com>...
>> I have been trying (in vain) to make a native call through the BDE to Sybase.  
>> Using the DBiGetProp function, this seems like it should be simple, but I must
>> be missing something obvious.

>> Does anyone have a (working) code snippet out there that they would be willing
>> to share (Delphi 1 or 2)?

>> The rest deleted for brevity...

--
Bob McClintock

Other Threads