Discussion Locked

SQL Timeout with VC++ cRecordSet

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a VC 6.00 app that adds a record to an SQL table using the cRecordSet class, usually it works but sometimes it throws a timeout exception, I cant seem to find a way of increasing this timeout, can anybody help?

1 reply

by dljohnston

The CRecordset object should have a member variable m_pDatabase. You could try this before adding records.

CRecordset.m_pDatabase->SetQueryTimeout(dwSeconds); //making sure that dwSeconds is sufficiently long so as not to timeout.
This should affect all the subsequent adds,deletes, etc.

/R/
D

This discussion is closed to new replies.