Help needed in solving a problem, thanks. Code Attached..
Hello All
I am facing a problem working with Berkely DB 4.5.20. I am trying to search in the database whether the key is already present or not. It is working fine with Microsoft Visual Studio but when i use the same code with Code::Blocks editor and MinGW compiler. It is not workig fine.
The code for searching the key is*****
bool CDbProject::IsKeyIndexAvailable(ProjectKey ProKey, UINT DataIndex)
int ret=0;
Dbc *cursorp;
bool flag=false;
cursor(NULL, &cursorp, 0);
//set the key
Dbt key(&ProKey, sizeof(ProKey));
Dbt data;
//search the database for the key.
ret = cursorp->get(&key, &data, DB_SET);
//ret = cursorp->get(&key, &data, DB_NEXT); //Rohit
if (!ret)
{ //if found check if the index is same
do
ProjectDataDetail *myProjDetails;
myProjDetails = (ProjectDataDetail*)data.get_data();
if (myProjDetails->uIndex==DataIndex)
flag = true;
break;
} while (cursorp->get(&key, &data, DB_NEXT_DUP) == 0); //Loop all the duplicate
if (cursorp != NULL)
cursorp->close();
return flag;
And the function to save the data in the database is *******
int CDbHandler::Put(void* pKey, size_t nKeyLen, void* pData, size_t nDataLen)
int ret = 0;
Dbt key(pKey, nKeyLen);
Dbt data(pData, nDataLen);
ret = put(NULL, &key, &data, DB_NODUPDATA);
if (ret==-30996)
ret = ERR_PROJECT_KEY_DATA_ALREADY_EXISTS;
return ret;
Please help...
Thanks in advance,,,
Message was edited by:
user610238
Thanks for the reply Sandra
I try to tell what is happening in the search key function, If still not possible, then i will try to create a stand alone application...
bool CDbProject::IsKeyIndexAvailable(ProjectKey ProKey, UINT DataIndex)
int ret=0;
Dbc *cursorp;
bool flag=false;
cursor(NULL, &cursorp, 0);
//set the key
Dbt key(&ProKey, sizeof(ProKey));
Dbt data;
//search the database for the key.
// SANDRA......If i use DB_SET,as you can see below. It is not able to find the key at all. BUt if i use DB_NEXT, then it is able to find the first key only everytime with the data also (Even if i am looking for some other key, it will find the first key saved always..)
ret = cursorp->get(&key, &data, DB_SET);
//ret = cursorp->get(&key, &data, DB_NEXT); //Rohit
if (!ret)
{ //if found check if the index is same
do
ProjectDataDetail *myProjDetails;
myProjDetails = (ProjectDataDetail*)data.get_data();
if (myProjDetails->uIndex==DataIndex)
flag = true;
break;
} while (cursorp->get(&key, &data, DB_NEXT_DUP) == 0); //Loop all the duplicate
if (cursorp != NULL)
cursorp->close();
return flag;
}
Similar Messages
-
My ipod touch 4G got problem after update to iOS 6, it can not access the Apps store ,can not access safari,map, weather and so on, could someone help me to solve the problem, thanks in advance~~~
Force close the App Store app and reset the iPad. No data will be lost when you reset the device.
In order to close apps, you have to drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
Next, reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up. -
HI
i have iPhone 4s with iOS 8.1.3 , since 2 days I'm facing a problem that the ring tone,lock button sound,password sound,volume buttons,slide volume and incoming call flash,
all these not working properly , sometimes it will work and sometimes it will not, I tried to restart the phone many times but I didn't fix the problem
plz help me to solve this problemTry to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again. You will not lose any data by resetting, but it can cure some glitches.
If this does not help, setting it up as new device would be the next step:
How to erase your iOS device and then set it up as a new device or restore it from backups -
Help needed to solve Biometric problem
Hi, I tried to execute example defined in JCBiometricsAPI_WhitePaper.pdf [which you can get from www.javacardforum.org/03_documents/00_documents/fileload_02.pdf] in biometric supported JCOP31 card. Where they are using password as the biometric template type. And here am able to upload the password into the server applet, but when I try to call the match method defined in the Client applet am getting 6F00 error message. please help me to resolve this.
Does anyone able to execute the example program successfully defined in www.javacardforum.org/03_documents/00_documents/fileload_02.pdf
-
hello, i need help i'm doing experiment on ilab i have managed to put my experiment on the platform but when i try to launch it fails with an error 404 that the page not found. any one with idea of what i should do to solve this problem. thank you
hey Sally,
Can you elaborate on the ilab and what you are trying to do? I have found this page to explain error 404, but I am not sure if it directly applies to you
http://digital.ni.com/public.nsf/allkb/D0998D3734926FA08625782300016E40?OpenDocument
Regards,
A. Zaatari
National Instruments
Applications Engineer -
Hello, I am using tesseract api in my app, which run perfectly on simulator but on test devise (real devise) it is showing an error i.e "apple mach -o linker error linker command failed with exit code 1", please any body help me to solve the problem
if you can't compile the webutil.pll in your forms developer you need to set the forms_builder_classpath in you windows registry. You have to add the frmwebutil.jar,jacob.jar to the registry key. The configuration files you mention are for running the forms.
-
please can you help me to solve my problem ( I have iphone is linked with Apple ID and I forgot that Apple ID and I can't remember it , I need thats Apple ID to activate my iphone ,,, what should I do ?
mohammed aljasim wrote:
there are many people that error is happened with them and one of this people is me ,, Apple must be find the solution for this problem
You are absolutely WRONG. Apple bears no responsibility in this at all. YOU purchased a STOLEN phone. You are guilty of receiving stolen property at best. Take it back to wherever you bought it and demand a refund. Failing that, turn it over to the police. You got ripped off. I'm sorry you wasted your money, but there is NOTHING Apple or anyone else can do for you. Only the rightful owner of the phone can unlock it. -
Dear Sir, i have problem in my Iphone 5 that during receiving any calls always appeare message that error in application occurred please call support quoting error code 2907. I need to solve my problem.
The problem this message always appeare when receiving the calls and requesting either accept or cancel.
Can you advice me if i have wrong application or i need to remove some applications. -
We have 'CS6' version of Adobe. We are facing a problem with 'Acrobat Pro'. Every month that is stop working and everytime need to install. Kindly help us regarding solving this problem...
Your Acrobat is running in Trial Mode. Try this KB: Creative Cloud applications unexpectedly revert to trial mode | CS6, CCM
If it doesn't work you need to contact Adobe Support for assistance. -
Thank you for providing immediate feedback. bt that solution did not help me to solve the problem.still am nt able to make outgoing calls. i dont find any problem in recieving calls also right. then i dont what is wrong with my iphone.The same sim which i used in iphone4s is working in all other phones.its not the problm of carrier.
Iphone 4s Black 16gbRather than starting a new thread every time it would be easier to follow you if you stick to the one thread
-
i just bought iphone5 last 2 weeks.At first week i can use itune apps after these last 3 days i try to use itunes again and i couldnt open it...same as app store...please help me to solve my problem...thanks and god bless...
Thanks Jakob. You are correct.
I just finished another "experiment".
I transcode the whole clip 1,2,3,4,5,6,7 to another ext Western Digital HDD and got the Error -50 too. Problem is this ext Western Digital HDD is Daisy chained to the LaCIe.
So, I tried transcoding to another ext Western Digital HDD connected to my router. And this time NO PROBLEM.
So, I should readjust the FW800 connectors.
What do you mean by the controller of the Firewire ?
Thanks
Jakob Peterhänsel wrote:
All I'm saying is, the error -50 from the Finder normally means there is something spooky going on.
Here, the LaCie drives become unstable. In the few cases where I'v actually opened the cage and put the HDD into another mount, the HDD seems to be fine, so I suspect it's either the FW connectors of the controller itself.
If the drive is under warranty, replace it, otherwise, move your data to another drive if it startes to do so frequently.
Here, the drive will 'behave' normally for some time after a reboot of the OS, but it's a pain to reboot every X hours... -
i need make icloud account but tell me the operation couldn't be completed please iam need to solve this problem necessary, Thank you
Why don't you use the option "Get a Free Apple ID" to create a new iCloud account with a free @icloud.com email address for all the iCloud service like Mail, Contacts, Calendars, Reminders, Notes Storage & Backup etc.?
This would be the easiest way. -
I have the following Imac and Iphoto 11 in Finder folder I upgrade the iphoto file and I lost all the latest event files, can you help how to solve the problem? Thank you
Model Name: iMac
Model Identifier: iMac8,1 Processor Name: Intel Core 2 Duo
Processor Speed: 2.4 GHzhttp://support.apple.com/kb/HT2638?viewlocale=en_US&locale=en_US
-
Hello i have a unusual problem,anyway my iphone 4 wont turn on and when someone calls they hear ringing,but my phone doesent ring.So i poen simcase and now ring off. Screen is just black,because it's turned off..Please help me to solve this problem..Thanks
As far as trying to power up your device, make sure it has a good charge and then hold the button on the top of the phone and the home button on the faceplate together until the apple appears on the screen.
-
Can you help me to solve this problem (user-exit for xd02)
Hi!
can you help me to solve this problem?
transaction XD02
To pass the length of the field to 7 max for KNA1-SORT (Search criterion 1 )
To pass the length of the field to 4 max for ADRC-SORT2 (Search criterion 2)
It is not possible to save the customer card as long as the search criterion is not univocal
I seek one to use-exit .
Thanks.Hi,
Check the exit SAPMF02D.
Regards,
Surinder
Maybe you are looking for
-
Jlaunch process is not running aftre system copy
Dear All, I am having EP Production server, which is on SGeSAP Cluster. We are planning to remove the cluster and move the EP Production to a standalone server. So we planned to do a system copy po this server. I have done a system copy of EP Product
-
IBooks won't open the first time
IiBooks will not open the first time white screen only. It takes 3-4 tries to actually open it
-
Location of security xml files for groups
We are having some issues migrating security(only) from one sysmte to another in EPM 11.1.2 for a planning application. Is there any other way to migrate security? Where are the xmls for each group's security stored?
-
How to avoid dropping iphone.
I am delighted with my new purchase but unlike the N95 it does not have a wrist strap. Are there any products out there that facilitate securing a strap with an adhesive. As an oldie I am terrified of dropping the iphone
-
Hi All, I am currently struggling trying to convert text that is in the picture format back to its string form. I have used "Draw Text at Point" Function (Graphics & Sounds - Picture Functions) to draw multi line text into a picture. I was able to