Solved

Converting datatypes of sybase to vc++

Posted on 2003-11-17
5
329 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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