 |
|
 |
Hello sir
When I want to compile your application, it compiles but in linking phase, it produce 10 errors
I added oci.lib in my project->settings->link->object/library. it's strange. please tell me how to solve this problem
Thank you very much for sharing your knowledge with people
Errors are:
test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall RecordSet::~RecordSet(void)" (__imp_??1RecordSet@@QAE@XZ)
test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl DisConnect(void)" (__imp_?DisConnect@@YAXXZ)
test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char * __thiscall Record::GetFieldValue(int)" (__imp_?GetFieldValue@Record@@QAEPADH@Z)
test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall Record::GetFieldsCount(void)" (__imp_?GetFieldsCount@Record@@QAEHXZ)
test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Record * __thiscall RecordSet::GetRecord(int)" (__imp_?GetRecord@RecordSet@@QAEPAVRecord@@H@Z)
test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall RecordSet::GetRecordsCount(void)" (__imp_?GetRecordsCount@RecordSet@@QAEHXZ)
test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall RecordSet::Open(char *)" (__imp_?Open@RecordSet@@QAEHPAD@Z)
test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall RecordSet::RecordSet(void)" (__imp_??0RecordSet@@QAE@XZ)
test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) int __cdecl Connect(void)" (__imp_?Connect@@YAHXZ)
..\Debug/test.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.
Creating browse info file...
test.exe - 10 error(s), 0 warning(s)
|
|
|
|
 |
|
|
 |
|
 |
hello
can you tell me how did you compile the sources?i'm a newbie to c++...did you use VC++ 2005...how?i have an Oracle 10g Express Edition Database on a Win XP...trying to use VC++2005 to compile it...i'm going crazy...it just won't work
What file are you compiling? test.cxx?
Pleeeeeeeeeesssssseeeeeee HELP !!!
|
|
|
|
 |
|
 |
Hi,
Verry nice job! It compiled with no problem and I was able to make a select in no time.
But I've tryed an insert with the function ExecCommand with no success.
Can you make some documentation regarding the usual functions or can you sugest how can I find the problem, how can I make an insert?
Thank you for your time,
-C
|
|
|
|
 |
|
 |
Hi.
My project is an application that operates on the MS Access database using (ODBC) CDatabase & CRecordset. it was working perfectly.
Then i create an Oracle database (tables) and now the same application can't show the record (type int) and it show instead some strange numbers in the edit contrl. -19841 something like this.
maybe the problem in the oracle unicode or in the convert that i use?
// here's an example:
char str[255];
int index=0;
CDBVariant var;
record.GetFieldValue(index,var);
wsprintf(str,"%d",var.m_iVal);
salary->SetWindowText(str);
I'm using VC++ 6.0 & Oracle 9i (9.2.0.1.0)
What you suggest?
Best regards.
|
|
|
|
 |
|
 |
I am developing a small application in VC++ which talks to the Oracle database for ita processing. What should be the best way to connect to the oracle database.
Can i use OCI library for that. what are the things to be installed on my machine to use this Library.
Please let me know this as soon as possible.
|
|
|
|
 |
|
 |
After a bit of Googling around, I found that oci.h and oci.lib are distributed with Oracle 10g XE database installation. You must include additional library directories:
C:\oraclexe\app\oracle\product\10.2.0\server\OCI\lib\MSVC (oci.lib)
C:\oraclexe\app\oracle\product\10.2.0\server\OCI\include (oci.h)
You will need to include both these additional library directories to both the dbclient and test applications (they are separate in the project).
You will also need to import the oci.h library using:
#pragma comment (lib, "oci.lib")
This may be a good way to connect to an Oracle database, but I can't get it to work yet, even though it compiles and runs -- the connection is no good. But I may be using it incorrectly.
I tried editing the definitions at the beginning of the dbclient.h file:
#define username "mpliam" //"energyuser"
#define password "silly1" //"ffffff"
#define servicename "MBPORCL1" //"db250"
but get this message:
-- ORACLE error--
ORA-12154: TNS:could not resolve the connect identifier specified
I also tried to use the direct connect function:
Connect(_T("mpliam"), _T("silly1"), _T("MBPORCL1"));
The resulting error was the same.
Any further suggestions greatly appreciated.
Michael Pliam
|
|
|
|
 |
|
 |
Can the lib handle CLOB data type??
Thks
Dino
|
|
|
|
 |
|
 |
i tryed do inser, but i can't.
|
|
|
|
 |
|
 |
I have my own project library that contains pro-C code (say function “X”) being called by some function (say “Y”) in the same library. I compile this library using my makefile to generate the target (say “Z.a).
I am replacing the pro-C function with OCI function. This library gets compiled fine after my changes.
There is a path where all project specific libraries (including Z.a) are kept. I replace this Z.a with my new version.
There is another file (say A.cxx) that is using this Z.a library. This file is calling function Y of Z.a library.
Now this file is getting compiled but I am getting linking error.
It says “Symbol referencing error”.
How can I get rid of this error? Have I missed including some OCI library for file A.cxx?
|
|
|
|
 |
|
 |
You have to link the oci.lib supplied with oracle db
|
|
|
|
 |
|
 |
There are memory bug in calss Record and calss cursor!
I modified it.
If someone want the source code,email me scy@huyou.com
|
|
|
|
 |
|
 |
oci bug in class RecordSet
void RecordSet::ResetRecords()
{
// RemoveAll(); //bug,not free the records memory!! deleted
RemoveAllRecords(); //replace by this method
if(datafmt)
free(datafmt);
datafmt=NULL;
m_nColNum =0;
}
void RecordSet::Reset()
{
RemoveAllRecords();
if(datafmt)
free(datafmt);
datafmt=NULL;
m_nColNum =0;
}
//added new method in class RecordSet
void RecordSet::RemoveAllRecords()
{
Node* pNode;
Record *pRec;
while(m_pNodeTail)
{
pNode=GetTail();
pRec=(Record *)pNode->data;
delete pRec;
RemoveTail();
}
m_pNodeHead = NULL;
}
//modify the Record class
Record::~Record()
{
Reset();
}
//added new method
void Record::Reset()
{
for(int n=0;n |
|
|
|
 |
|
 |
"store the query result in a simple linklist."
Since you are only using a linklist to store the return the record set. Could it not be possible to run out of memory on the client machine? If a user ran a huge transaction that returns something like 200,000 records and does this several times (with different connections) the client could run out of memory fast. How could this program be modified to handle this kind of senerio?
|
|
|
|
 |
|
 |
Yes ! You are right. can you solve this problem?
|
|
|
|
 |
|
 |
If I want make up a great database of image,what should I do?Look what books? How can I do? Thank you very much!
|
|
|
|
 |
|
 |
It seems that your Connect/Disconnect code is global.
Does that means that you can not have more than one Oracle
connection open at the same time ?
Miroslav Rajcic
|
|
|
|
 |
|
 |
I write this c++ wrapper for my application.
it really only support one Oracle connection.
if you want it support multi connections,need change it properly!
|
|
|
|
 |