?
Solved

Converting datatypes of sybase to vc++

Posted on 2003-11-17
5
Medium Priority
?
333 Views
Last Modified: 2007-12-19
Hi all,
  I am using VC++ .NET and sybase as backend.  I have established the connectivity through the 12.5 ASE Sybase driver

  Here is the code:

  SQLSMALLINT      GetDefaultCType(SQLINTEGER SQLType)
{
      SQLSMALLINT rtn = SQLType;
      switch (SQLType)
            {
            case SQL_INTEGER:
                  rtn = SQL_C_LONG;
                  break;
            case SQL_SMALLINT:
                  rtn = SQL_C_SHORT;
                  break;
            case SQL_REAL:
                  rtn = SQL_C_FLOAT;
                  break;
            case SQL_DOUBLE:
                  rtn = SQL_C_DOUBLE;
                  break;
            case SQL_NUMERIC:      
                  rtn = SQL_C_NUMERIC;
                  break;
            //---
                  
            case SQL_VARCHAR:
                  rtn = SQL_C_CHAR;
                  break;

            //---
            }
      return rtn;
}

 I use SQLBindParameter
There is some problem when the datatype is SQL_SMALLINT or any number datatype.  

Can any one help us.
0
Comment
Question by:ajexpert
5 Comments
 
LVL 14

Author Comment

by:ajexpert
ID: 9763512
The exact problem is when the datatype is numeric it doesnt fetches the value from database.  It either gets garbage value or zero values.

Please help
0
 
LVL 35

Expert Comment

by:YZlat
ID: 9811246
ajexpert, go to http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20798137.html 


I gave you some points and you never got them
0
 
LVL 14

Author Comment

by:ajexpert
ID: 9817533
Hi community experts,
  I request for deleting of this question.  The problem is resolved.

  It was not parsing numeric data into equivalent vc++.


Thanks
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10268094
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10321348
PAQed, with points refunded (50)

modulo
Community Support Moderator
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Loops Section Overview
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question