Hello
Thank you for such a fast answer... :)
If you could write some really simple example how to connect and take some
information from SQL thru ODBC.... I think that this is the best choice for
me.
thank you again
best regards
Mariusz
> > Hellow
> >
[quoted text clipped - 16 lines]
>
> -cd
Carl Daniel [VC++ MVP] - 14 Jul 2004 22:31 GMT
> Hello
>
[quoted text clipped - 3 lines]
> some information from SQL thru ODBC.... I think that this is the best
> choice for me.
I don't speak ODBC, but you might want to ask that question on
microsoft.public.vc.mfc (MFC provides wrappers for ODBC) or on
microsoft.public.data.odbc.
-cd
William DePalo [MVP VC++] - 15 Jul 2004 00:28 GMT
> If you could write some really simple example how to connect and take some
> information from SQL thru ODBC.... I think that this is the best choice for
> me.
Carl's advice about the other groups is right on the money.
I'd go further and suggest you find a good book or use the online MSDN
reference. ODBC tries to be DBMS neutral but it doesn't try at all to shield
you from complexity and it is _huge_. It's not something you pick up in an
afternoon.
I just scanned the source to an application I wrote about a decade ago. It
appears that it takes three executable lines to connect:
HENV hEnvironment;
HDBC hDbConnection;
RETCODE rc;
rc = SQLAllocEnv(&hEnvironment);
rc = SQLAllocConnect(hEnvironment, &hDbConnection);
rc = SQLDriverConnect(hDBConnection, /*several more parameters go here*/);
The most important parameter in the last call is the connection string,
which for SQL Server looks something like this:
"DSN=MyODBCDataSetName;Description=MyAppDescription;UID=MyXPUserName;APP=MyA
ppName;WSID=SQLServerName;Trusted_Connection=Yes"
Regards,
Will