Question : C / C++ DSN connect (.mdb)

Hello.

I have database with name dbcust.
Tablename - customers.
Column - ip_address.

I need to connect dsn and run query "select ip_addr from customers where ip_addr = VARIABLE";
If ip address exist then function will return true.
Else - return false.

I need C or C++ sample code (MS Visual studio 2008).
This code should work in ISAPI Filter.

Thanks.


Answer : C / C++ DSN connect (.mdb)

This article shows how to use ADO

ADO Database Access with C++
http://www.experts-exchange.com/A_1244.html

If you are using MFC, its actually quite a bit easier.  Just create a CDatabase object:
http://msdn.microsoft.com/en-us/library/hbftwssy(VS.80).aspx

...and execure this SQL statement:

  SELECT COUNT(*) FROM customers WHERE ip_addr= (put ip address here)

A non-zero return indicates that at least one match was found.

Random Solutions  
 
programming4us programming4us