Click here to Skip to main content
15,887,302 members
Home / Discussions / Database
   

Database

 
AnswerRe: ORDER BY @Variable??? Pin
twostepted30-Oct-05 17:39
twostepted30-Oct-05 17:39 
GeneralRe: ORDER BY @Variable??? Pin
Carl Mercier30-Oct-05 19:19
Carl Mercier30-Oct-05 19:19 
GeneralRe: ORDER BY @Variable??? Pin
twostepted31-Oct-05 12:56
twostepted31-Oct-05 12:56 
AnswerRe: ORDER BY @Variable??? Pin
Edbert P31-Oct-05 12:20
Edbert P31-Oct-05 12:20 
QuestionOptimization - newbie problem Pin
gbaii29-Oct-05 0:36
gbaii29-Oct-05 0:36 
AnswerRe: Optimization - newbie problem Pin
Edbert P31-Oct-05 12:28
Edbert P31-Oct-05 12:28 
GeneralRe: Optimization - newbie problem Pin
gbaii1-Nov-05 7:31
gbaii1-Nov-05 7:31 
QuestionMessage for Vijay Mathew Pandyalakal re Easy_odbc Pin
mville28-Oct-05 21:02
mville28-Oct-05 21:02 
Excuse me if this is old news, I had some run time problems using easy_odbc in conjunction with the MSaccess ODBC driver. The problems were to do with ODBC exception handling for the most part. I had a freind look at it and he came up with some suggestions for patches. Following is the output of a WINDIF compare of the original and patched versions of easy_odbc.cpp and test.cpp. The changes are a bit over my head but the original problems are well and truly fixed, thought this might be useful to someone. On a related subject, is there any way to insert the contents of a variable in line with an SQL query? Something like the following:

// fills a ResultSet with some data
easyodbc::ResultSet rslt = db.ExecuteQuery("SELECT * FROM kids" WHERE name =
MYVARIABLE);

Patch for easy_odbc.cpp:



long Database::Execute(const char* sql) {
try {
if(!this->m_bOpened) {
throw EasyODBCException("Call Open() before
Execute()",-1);
}

<! SQLRETURN ret = SQLPrepare(this->m_hStmt,(unsigned
char*)sql,
!> SQLFreeStmt(this->m_hStmt,SQL_CLOSE);
!> SQLRETURN ret = SQLAllocStmt(this->m_hDbc, &this->m_hStmt);
!> if(ret == SQL_ERROR || ret == SQL_INVALID_HANDLE || ret < 0)
{
!> HandleError("DBC");
!> }
!>
!> ret = SQLPrepare(this->m_hStmt,(unsigned char*)sql,


Patch for test.cpp:


// closes the database connection
db.Close();
<! }catch(easyodbc::EasyODBCException *ex) {
!> }catch(easyodbc::EasyODBCException ex) {
<! char buff[51];
<! ex->GetMessage(buff);
<! printf(buff);
!> char buff[2000] = {0};
!> ex.GetMessage(buff);
!> printf("%s\n", buff);
}
return 0;
}





--

Regards
Michel de la Villefromoy
Questionconnect to remote oracle Database Pin
odukuye28-Oct-05 10:40
odukuye28-Oct-05 10:40 
QuestionADV ICE WANTED!! Pin
jaygreen928-Oct-05 8:59
jaygreen928-Oct-05 8:59 
AnswerRe: ADV ICE WANTED!! Pin
Colin Angus Mackay28-Oct-05 13:19
Colin Angus Mackay28-Oct-05 13:19 
QuestionProblem with working SQL Server SAVE POINTS in Transactions. Pin
farhan197627-Oct-05 20:11
farhan197627-Oct-05 20:11 
QuestionTriggers and transaction context. Pin
devvvy27-Oct-05 6:15
devvvy27-Oct-05 6:15 
AnswerRe: Triggers and transaction context. Pin
Farhan Noor Qureshi27-Oct-05 9:21
Farhan Noor Qureshi27-Oct-05 9:21 
GeneralRe: Triggers and transaction context. Pin
devvvy27-Oct-05 13:49
devvvy27-Oct-05 13:49 
QuestionDatabase 'foodmart 2000' does not exist Pin
kuldeep_kumar27-Oct-05 5:25
kuldeep_kumar27-Oct-05 5:25 
QuestionDynamic procedures, are they possible? Pin
FruitBatInShades27-Oct-05 3:59
FruitBatInShades27-Oct-05 3:59 
AnswerRe: Dynamic procedures, are they possible? Pin
Colin Angus Mackay27-Oct-05 6:31
Colin Angus Mackay27-Oct-05 6:31 
AnswerRe: Dynamic procedures, are they possible? Pin
codet28-Oct-05 16:28
codet28-Oct-05 16:28 
QuestionProblems inserting data in database with datagrid Pin
wappi_berlin27-Oct-05 1:44
wappi_berlin27-Oct-05 1:44 
QuestionExcluding some fields from a table in a datagrid Pin
odrap26-Oct-05 0:24
odrap26-Oct-05 0:24 
AnswerRe: Excluding some fields from a table in a datagrid Pin
Edbert P26-Oct-05 12:50
Edbert P26-Oct-05 12:50 
QuestionInsert Data via Stored procedure by ado.net Pin
thedom225-Oct-05 23:33
thedom225-Oct-05 23:33 
AnswerRe: Insert Data via Stored procedure by ado.net Pin
Edbert P26-Oct-05 12:52
Edbert P26-Oct-05 12:52 
GeneralRe: Insert Data via Stored procedure by ado.net Pin
thedom226-Oct-05 13:16
thedom226-Oct-05 13:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.