|
Hi all,
I'm trying to connect to an Oracle database, with the following function:
...
ret = SQLConnect(m_hDbc,
(SQLCHAR*)szDSN,
strlen(szDSN),
(SQLCHAR*)szUser,
strlen(szUser),
(SQLCHAR*)szPass,
strlen(szPass));
...
But I keep recieving the following error:
[Microsoft][ODBC driver for Oracle][Oracle]ORA-12154: TNS:could not resolve the connect identifier specified
I have added the entry to the tnsnames.ora file, and checked the "tnsping" using TNS service name, which worked.
Can anyone please help?
Many Thanks in advacne
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
hi
try this code to connect to oracle
SAConnection con; // connection object
SACommand cmd; // command object
{
con.Connect("test", "tester", "tester", SA_Oracle_Client);
cmd.setConnection(&con);
}
|
|
|
|
|
I want to know a computer's byte order.
Somebody would like to tell me how to get the order?
Thanks.
GOOD LUCK.
|
|
|
|
|
It depends on your CPU. I believe most (if not all) PCs are Little-Endian, meaning (going off memory here) that the bytes are ordered, within a word, with the least significant byte first. You can google "Endian-ness" for a more complete and correct answer.
|
|
|
|
|
OK,I will go and have a look.
Thanks.
|
|
|
|
|
|
Maxwell Chen wrote: Endianness[^]
Were you afraid that kcynic would not be able to Google the suggestion from Azteke correctly?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
One way to do it. I'm not sure if it works on 64-bits CPU's though.
Remark (before I get flamed): Yes, it is old C code.
Detection of Little- and Big-endian:
bool bIsLittleEndian = false;
unsigned int test = 0x12345678;
unsigned char firstByte = *(unsigned char *) &test;
if(firstByte == 0x78) bIsLittleEndian = true;
Detection of Little-, Middle and Big-endian:
enum {LITTLE_ENDIAN, MIDDLE_ENDIAN, BIG_ENDIAN};
int endian;
unsigned int test = 0x12345678;
unsigned char firstByte = *(unsigned char *) &test;
if(firstByte == 0x78) endian = LITTLE_ENDIAN;
else if(firstByte == 0x34) endian = MIDDLE_ENDIAN;
else endian = BIG_ENDIAN;
-- modified at 5:38 Friday 14th September, 2007
Maxwell Chen made me aware there are such a thing as Middle-endian, so I made another sample. (Middle-endian is appearantly used in some PDAs and mobile phones that is using CPU's with ARM architecture.)
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
|
Thanks for the comment.
I will change my reply, since it could be fatal to execute my code on a PDP 11 machine.
OK, it seems as some PDAs and mobile phones uses CPU's with ARM architecture. That scenario seems a bit more likely. I will change my reply accordingly.
Thaks for pointing it out.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Kakan,
That's interesting, I never though of using code to determine the Endian=Ness. I'll remember that.
Azteke
|
|
|
|
|
Hi, I'm working on a project where I need to do the following:
1) Constantly (at some defined rate that approximates "constant") sample the microphone input.
2) Take the input that is read and determine the frequency of the tone being input.
If it's possible, number 2 would run on each execution cycle. The idea is to have a big if-block that performs different logic depending on what range the frequency is in.
What I need is an API (and a document to help explain it would be helpful) that will allow me to do this sampling/frequency determination. I'm new to PC programming for the most part, coming from about a year and a half of embedded (fairly basic) development, but I'm excited to start learning! I do know the basics of MFC apps/dialogs and I have VS2005 Professional at my disposal.
The one last thing is that I would like this to run on Linux also eventually so if there's a good API that is cross-platform that would be ideal if it doesn't add too much trouble.
Much appreciated,
Tim
|
|
|
|
|
|
Ressell, after a quick scan-through I think that third link is exactly what I need. Thanks. Does anyone know of a cross platform API though for future Linux ports?
Thanks,
Tim
|
|
|
|
|
Thanks
About Linux:
I don't know anything about it to help you, sorry.
You can start a new thread,...but think also to post it in another forum: here more than 90% of members are expert on Windows. I don't want to mean that here noone can help you, but that it is not so impossible.
good luck
Russell
|
|
|
|
|
Hello,
Good Day!
Step 1:
struct user
{
unsigned short us_nbs;
unsigned short us_debit;
unsigned short us_flowctrl;
};
Step 2:
In another header file contains this:
"class C_User : public CObject, public user"
Step 3:
class C_Subscriber : public C_User
Step 4:
C_Subscriber subdeviceSubs = *lpSubscr;
Step 5:
I got that us_flowctrl value is "0" by executing this statement : subdeviceSubs.us_flowctrl. How?
Thanks in advance
Raja Ratheesh
-- modified at 1:56 Friday 14th September, 2007
|
|
|
|
|
rajaratk wrote: C_Subscriber subdeviceSubs = *lpSubscr;
What is this lpSubscr?
- NS -
|
|
|
|
|
Instance of
typedef struct user far *LPUSER;
|
|
|
|
|
So you are getting values changed...
class C_User : public CObject, public user
class C_Subscriber : public C_User
typedef struct user far *LPUSER
C_Subscriber subdeviceSubs = *lpSubscr;
So the C_Subscriber has CObject in the first memory area. I doubt that it could be the problem.
Dont you get any compilation error by "C_Subscriber subdeviceSubs = *lpSubscr;" ?
- NS -
|
|
|
|
|
Hi friends........
I have a question on tab oreder.......?
How the tab order will effect the visibility of controls placed on a dialog?
Thank u in advance.....
Sairam Madem
|
|
|
|
|
The WS_VISIBLE style effects the visibility of controls on a dialog.
If you meant the Z-order, the controls are created in the order they
appear in the DIALOG resource, so initially, the first control will be at the
bottom of the z-order, the last control at the top.
Setting the tab order sets the order of the control definitions in the resource.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
it is a simple logic.
the control that has the least taborder will be placed first on the dialog.
then any other control with a higher taborder will be placed next.
this means that,
the later control, if it is located at the same place as the former control will obviously overlap the former.
in the past, once i faced the same problem. i had to struggle for two days to find out that taborder is the reason for the controls that are invisible.
is int it very funny?
gud luck.
|
|
|
|
|
chandu004 wrote: i had to struggle for two days to find out that taborder is the reason for the controls that are invisible.
- NS -
|
|
|
|
|
Hopefully this makes sense, here goes:
I've upgraded my MSVS C++ 6.0 MFC application to MSVS C++ 2005. All went well - no big issues - but here's what I can't figure out: In my resource browser my MFC dialog app appears to have that updated .NET style, i.e. rounded glossy buttons & list controls. That's how I would like it to appear when built; however, it still has that "old-school" MFC look with the square edge buttons and "3D" look.
I've created a new MFC dummy app just to compare headers and resource files in Araxis Merge to see if I could find some "switch" somewhere that needs to be set. The dummy app has that contemporary .NET look. I can't seem to figure out what I need to set to accomplish this task.
Any help or advice would be GREATLY appreciated.
Thanks,
CMD
|
|
|
|
|