CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    About ODBC data types

    I use SQLDescribeCol in my programe.


    SQLCHAR ColName[50];
    SQLSMALLINT NameLen=0,DataType,DecDigits,Nullable;
    SQLUINTEGER ColSize;
    CString Column="CREATE TABLE e_usrnew(";
    CString Length;
    CString Name;

    BOOL matched=FALSE;
    for(i=1;i<18;i++)
    {
    sr=SQLDescribeCol(hstmt,i,ColName,50,&NameLen,&DataType,
    &ColSize,&DecDigits,&Nullable);
    Length.Format("%d",ColSize);
    Name=ColName;
    if(DataType==SQL_VARCHAR)
    {
    Column=Column+Name+" VARCHAR("+Length+"),";
    }
    if(DataType==SQL_TYPE_DATE)
    {
    Column=Column+Name+" DATE,";
    }
    if(DataType==SQL_BIT)
    {
    Column=Column+Name+" BIT,";
    }
    if(DataType==SQL_NUMERIC)
    {
    matched=TRUE;
    }
    }




    DataType is 8.I tried SQL_DECIMAL,SQL_NUMERIC,SQL_SMALLINT,SQL_INTEGER.They all don't match DataType.
    Help me ,please!


  2. #2
    Guest

    Re: About ODBC data types

    If you look at the sql datatypes in sql.h you will find that 8 is SQL_DOUBLE.




  3. #3
    Guest

    Re: About ODBC data types

    You give me the answer and the way to find answers.
    Thank you very much


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured