I have an application that is using the Visual Studio 2008 environment
but the project is a 'C' project (everything is using C conventions
and compile options). We are making sure that there is no C++ in this
application for coding reasons I'm not going to go into. Just note
that we have to do it this way.

Here's my issue, I need to have part of the code get data from a Jet
database and connect/use a SQL 2005 database. If this were C++ I could
use #import and recordbinding (love record binding) and be done with
it. How can I do the same operations (perferably with some
recordbinding) in C? Is there a header or something easy to use or do
I need to traverse all of the notions of COM by hand. Please note that
ADO's record binding is one of the key features that I would like to
duplicate in this C code.

Thanks for all the help or pointers (pun) and I wish you a very good
day. I am finding this more challanging the deeper I look.

Re: need C code to reference ADO .. how? by Alf

Alf
Wed Jul 23 18:53:40 CDT 2008

* beginthreadex:
> I have an application that is using the Visual Studio 2008 environment
> but the project is a 'C' project (everything is using C conventions
> and compile options). We are making sure that there is no C++ in this
> application for coding reasons I'm not going to go into. Just note
> that we have to do it this way.
>
> Here's my issue, I need to have part of the code get data from a Jet
> database and connect/use a SQL 2005 database. If this were C++ I could
> use #import and recordbinding (love record binding) and be done with
> it. How can I do the same operations (perferably with some
> recordbinding) in C? Is there a header or something easy to use or do
> I need to traverse all of the notions of COM by hand. Please note that
> ADO's record binding is one of the key features that I would like to
> duplicate in this C code.
>
> Thanks for all the help or pointers (pun) and I wish you a very good
> day. I am finding this more challanging the deeper I look.

Is this not possible using ODBC?

You'd not get ADO's record binding, true.

By the way, I think chances are high that your reasons for avoiding C++ here are
invalid on technical grounds, but if they're "political" then in practice there
may be no way around.

On the design level it seems the application is mixing GUI and business logic
(generally ungood), or is all pure GUI.

If it's all pure GUI, why not make it in some scripting language (hey, look, no
C++)?


Cheers, & hth.,

- Alf

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Re: need C code to reference ADO .. how? by fernando

fernando
Wed Jul 23 19:40:38 CDT 2008

beginthreadex wrote:
> I have an application that is using the Visual Studio 2008 environment
> but the project is a 'C' project (everything is using C conventions
> and compile options). We are making sure that there is no C++ in this
> application for coding reasons I'm not going to go into. Just note
> that we have to do it this way.
>
> Here's my issue, I need to have part of the code get data from a Jet
> database and connect/use a SQL 2005 database. If this were C++ I could
> use #import and recordbinding (love record binding) and be done with
> it. How can I do the same operations (perferably with some
> recordbinding) in C? Is there a header or something easy to use or do
> I need to traverse all of the notions of COM by hand. Please note that
> ADO's record binding is one of the key features that I would like to
> duplicate in this C code.
>
> Thanks for all the help or pointers (pun) and I wish you a very good
> day. I am finding this more challanging the deeper I look.

The following is the first of a series of interesing articles that shows
how to use COM from plain C. Perhaps you can start here and then use it
to interact with ADO and its Record Binding.

http://www.codeproject.com/KB/COM/com_in_c1.aspx

Regards.

Re: need C code to reference ADO .. how? by beginthreadex

beginthreadex
Wed Jul 23 19:59:48 CDT 2008

My reasons for avoiding C++ are deep, and generally not technically
related to using C++ itself but more to use C exclusively. I'd rather
not discuss my exact reasons for this need but I can say that it seems
that you might have insight and wisdom.

The application has no GUI as it's an NT Service. Scripts of VBS/JS
are not allowed at that level. Again, strict C is a requirement
dictated by specification.

If you can direct me to an ODBC 'C' implimentation or some direction
on how to get to this I would appreciate it.



On Thu, 24 Jul 2008 01:55:41 +0200, "Alf P. Steinbach"
<alfps@start.no> wrote:

>* beginthreadex:
>> I have an application that is using the Visual Studio 2008 environment
>> but the project is a 'C' project (everything is using C conventions
>> and compile options). We are making sure that there is no C++ in this
>> application for coding reasons I'm not going to go into. Just note
>> that we have to do it this way.
>>
>> Here's my issue, I need to have part of the code get data from a Jet
>> database and connect/use a SQL 2005 database. If this were C++ I could
>> use #import and recordbinding (love record binding) and be done with
>> it. How can I do the same operations (perferably with some
>> recordbinding) in C? Is there a header or something easy to use or do
>> I need to traverse all of the notions of COM by hand. Please note that
>> ADO's record binding is one of the key features that I would like to
>> duplicate in this C code.
>>
>> Thanks for all the help or pointers (pun) and I wish you a very good
>> day. I am finding this more challanging the deeper I look.
>
>Is this not possible using ODBC?
>
>You'd not get ADO's record binding, true.
>
>By the way, I think chances are high that your reasons for avoiding C++ here are
>invalid on technical grounds, but if they're "political" then in practice there
>may be no way around.
>
>On the design level it seems the application is mixing GUI and business logic
>(generally ungood), or is all pure GUI.
>
>If it's all pure GUI, why not make it in some scripting language (hey, look, no
>C++)?
>
>
>Cheers, & hth.,
>
>- Alf


Re: need C code to reference ADO .. how? by Igor

Igor
Wed Jul 23 20:43:28 CDT 2008

"beginthreadex" <beginthreadex@gmail.com> wrote in message
news:dpkf84hvt7bmqp2mlc39cu9cadhl6dip86@4ax.com
> If you can direct me to an ODBC 'C' implimentation or some direction
> on how to get to this I would appreciate it.

http://msdn.microsoft.com/en-us/library/ms710252.aspx
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925