Originally posted by: Mike
Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
Here's the code I'm using:
int main(){
Any help would be greatly appreciated!
Mike
I'm sorta new to C++, so this may be an ignorant question. I'm trying to compile the simple open db example here with my command line compiler, but I'm getting the following errors:
dbopen.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'CSQLDatabase::~CSQLDatabase()' referenced from C:\BORLAND\BCC55\DBOPEN.OBJ
Error: Unresolved external 'CSQLDatabase::CSQLDatabase()' referenced from C:\BORLAND\BCC55\DBOPEN.OBJ
Error: Unresolved external 'CSQLDatabase::Open(const char *, const char *, const char *)' referenced from C:\BORLAND\BCC55\DBOPEN.OBJ
#include "SQLBase.h"
#include "SQLBaseWhere.h"
#include "SQLDatabase.h"
#include "SQLDelete.h"
#include "SQLInsert.h"
#include "SQLRecordset.h"
#include "SQLUpdate.h"
#include <iostream>
CSQLDatabase db;
if ( ! db.Open( "Cokes_Dev" ) )
{
cout << "couldn't open data source name" << endl;
return 0;
}
return 0;
}
Originally posted by: Alfredo Camba Fontevedra
To much thank you for your help and libraries and only a question: you have a little mistake in SQLDatabase.cpp line 62. Sorry for my english.
ReplyOriginally posted by: bt
bool CSQLDatabase::Close()
if ( _hdbc )
_isOpen = false;
In the 'Close' member function the _isOpen flag is not being checked correctly. The current version (below) causes huge memory leaks when a database is open/closed repeatedly. The If statement should be changed to read 'if (!_isOpen)'.
{
if ( _isOpen )
return false;
{
_rc = ::SQLDisconnect( _hdbc );
if ( _rc == SQL_SUCCESS || _rc == SQL_SUCCESS_WITH_INFO )
_rc = ::SQLFreeHandle( SQL_HANDLE_DBC, _hdbc );
}
if ( _henv )
_rc = ::SQLFreeHandle( SQL_HANDLE_ENV, _henv );
return true;
}
Originally posted by: jhwang
^_^
ReplyOriginally posted by: Karthick
Can I do database connectivity using palin c under windows? can u help me in that?
ReplyOriginally posted by: Berger
Hello,
I tried to add a cursor to the example, but there is always a abnormal program termination thrown !
I used this :
rs << "BEGIN";
rs.SQLExecDirect();
rs << "DECLARE CURSOR cu FOR SELECT adress1 FROM provider";
This works with PostgreSQL but not with MSAccess,
is anybody able to explain why, or how to solve this problem ?
Thanks
berger
Originally posted by: Jason Jennings
I may (if i can figure out how) post my changes to Mr. Henri's code. I recently inquired about adding cursor support and row counts. After a bloody head and careful reading with the lights on. I figured how to change Mark's code from the default cursor to a static one. I needed a way of moving forward and backward with a handy row count at my side. Along the way I made a few rearrangements and changes to his objects. Until I figure out how to post the objects, just email me. I need to add better suport (or tons more helpful diagnostic stuff) for changing the cursor type.
Jason Jennings
Originally posted by: Jeff
Hey Mark,
Thanks for taking the heartache out of ODBC for me! I love what you've done with these SQL classes!
Just a minor housekeeping comment: in SQLClasses.zip, SQLUpdate.cpp has a reference to Str.h. In SQLClasses_easy_odbc.zip, you actually did the cleanup so that SQLUpdate.cpp no longer references TStr.
Sorry for the idiots who don't recognize A Good Thing when it's posted. Please ignore the DUH posts; there are those of us who appreciate A Good Thing.
A million thanks!
jw
ReplyOriginally posted by: Jason Jennings
Mr. Mark,
Thank you for pulling together a nice set of DB and RS OBDC classes. I was working with the ODBCCore classes, off of code guru, and switched to yours. In both examples, the record count was not implemented. I messed around with the ODBCCore classes trying to get a RowCount () to work. I haven't been able to use the ODBC docs and examples to pull this off. Have you incorporated a RowCount () in your ODBC classes? Changing cursor types is another big area of pain. I have a difficult time determining whether or not I have set the cursor type correctly. This may be why I can't resolve the record count. I know the forward only cursors return -1 for the number of records in the record set. Naturally the default is forward only. It would be a huge help if you could pass on any insight for implementing record counts and cursor types.
Originally posted by: Le Lanx
Excellent work!!!!!!!!!!!!!!!!
Reply