Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC update problem

Status
Not open for further replies.

Buki

Technical User
Apr 25, 2003
1
CA
Hello all.

I'm in the process of adding simple ODBC functionnality to our in-house software. So far I can retrieve text & int data and then update the database. I'm using win2000, Visual Studio 6 (w/ C), SQL Server 2000 and the Northwind demo database. I had previously no experience with SQL nor ODBC.

This Query is my problem right now. It aims to change the city of an employee, based on his primary key that was retrieved earlier. I had no problem with update queries using string comparison (ie : where "firstname" like 'andrew' is ok), but this here, using an int as a comparison, just hangs on execution.

The same query, run in Query Analyzer, works just fine, so the problem is just when I make the ODBC call in C.

I tried tracing the driver call from Query Analyzer and my program call, but they are the same (programmed one just seems to run forever).


Query (northwind) :

pszQuery <=> update &quot;Employees&quot; set &quot;City&quot; = 'Citytest' where &quot;EmployeeID&quot; = 1
SQLExecDirect(hstmt1,pszQuery,SQL_NTS)


Does anyone here have an idea about this ? I may be doing something stupid, but I have no clue what...

Many thanks in advance.

--
Sebastien Ruchet / sruchet@NOSPAMwizart.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top