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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SQLBindParameter to insert a SQL DATETIME

Status
Not open for further replies.

williamu

Programmer
Apr 8, 2002
494
GB
Hi All,

I have a table that contains various datetime fields, however when I try to enter a datetime the SQLBindParameter function fails.

The Functions is being called like this:

SQLBindParam(hStmt,
10,
SQL_PARAM_INPUT,
SQL_C_TIMESTAMP,
SQL_TYPE_TIMESTAMP,
0,
0,
&pItem->m_dtDOB.m_Date,
0,
0) ;

I'd better mention that the pItem->m_dtDOB is in fact a custom class the contains a member variable called m_Date. With m_Date a TIMESTAMP_STRUCT.

I guess I must be using SQLBindParameter incorrectly but I can't see where. I've read the docs but I've still got a question mark above my bald head on this one.

Any help would be very much appreciated, as this is really holding back development.

If you require more information that I've supplied then please ask, I'll be more than happy to do so.
William
Software Engineer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top