Perform SQL statement in VC++ against MS SQL Server 7.0 
Author Message
 Perform SQL statement in VC++ against MS SQL Server 7.0

I have VC++ 6.0, NT 4.0 with MS SQL Server 7.0.

I want to perform the following SQL statement

update table
set fielda = "1234"
where fieldb = "2222"

I know how to do this on a single record at a time with a recordset.update.

I want to be able to just use a complete SQL statement to perform a generic update or insert?

Like:
         execsql
                update table
                set fielda = "1234"  
                where fieldb = "2222"
        endexec

TIA,

Lawrence M. Seldin, CMC, CPC
Author of POWER TIPS FOR THE APPLE NEWTON and INTRODUCTION TO CSP



http://www.*-*-*.com/



Tue, 22 Jan 2002 03:00:00 GMT  
 Perform SQL statement in VC++ against MS SQL Server 7.0
Create a CDatabase object and use OpenEx and ExecuteSQL (and Close).

Quote:
> I have VC++ 6.0, NT 4.0 with MS SQL Server 7.0.

> I want to perform the following SQL statement

> update table
> set fielda = "1234"
> where fieldb = "2222"

> I know how to do this on a single record at a time with a
recordset.update.

> I want to be able to just use a complete SQL statement to perform a

generic update or insert?

Quote:

> Like:
>     execsql
>            update table
>            set fielda = "1234"
>            where fieldb = "2222"
>            endexec

> TIA,

> Lawrence M. Seldin, CMC, CPC
> Author of POWER TIPS FOR THE APPLE NEWTON and INTRODUCTION TO CSP



> http://ourworld.compuserve.com/homepages/seldin

--
"You think you know when you learn, are more sure
when you can write, even more when you can teach,
but certain when you can program."
Tolkien Ring is the preferred LAN in Middle Earth.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Tue, 22 Jan 2002 03:00:00 GMT  
 Perform SQL statement in VC++ against MS SQL Server 7.0
John,

Thanks much...

Quote:

>Create a CDatabase object and use OpenEx and ExecuteSQL (and Close).

Lawrence M. Seldin, CMC, CPC
Author of POWER TIPS FOR THE APPLE NEWTON and INTRODUCTION TO CSP



http://ourworld.compuserve.com/homepages/seldin



Sun, 27 Jan 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to perform an SQL statement with VC++

2. Q:Use DISTINCT in SQL statement with OLE DB for SQL Server

3. Using DAO with MS SQL Server 7.0

4. OLEDB consumer: IRowsetIndex and MS SQL Server 7.0

5. Visual C++, ODBC and MS SQL Server 7.0

6. Visual C++, ODBC, and MS SQL Server 7.0

7. Visual C++, ODBC and MS SQL Server 7.0

8. How do you run a SQL Server sql script file against a SQL Server database?

9. Invoking MS SQL Server Procedures from VC++

10. VC++ Enterprise boxed with MS SQL Server, Developer Edition 6.5

11. Crystal Reports: SQL Server & MS VC++ 6.0

12. ADO Update very slow against SQL Server 6.5

 

 
Powered by phpBB® Forum Software