ODBC SQLConnect - unsigned char problems

ODBC SQLConnect - unsigned char problems

Post by Kris Munc » Thu, 30 Jul 1998 04:00:00



I am writing a simple app that connects to a SQL Server database using
ODBC. I am trying to use the statement
SQLConnect(hdbc,"myodbcconnection",SQL_NTS,"myusername",SQL_NTS,
"mypassword",SQL_NTS);

But I am getting a compiler error that my string "myodbcconnection" is
not of type
unsigned char, which is how the statement is defined. The help files do
this, but I cannot get it to compile.

Amy help is appreciated.

Kris Munch

 
 
 

ODBC SQLConnect - unsigned char problems

Post by G Che » Thu, 30 Jul 1998 04:00:00


This should work:

  m_sqlRet = SQLConnect(m_hDbcc, (SQLCHAR*) szSource,            SQL_NTS,
(SQLCHAR*) szUid, SQL_NTS, (SQLCHAR*) szPwd, SQL_NTS);


>I am writing a simple app that connects to a SQL Server database using
>ODBC. I am trying to use the statement
>SQLConnect(hdbc,"myodbcconnection",SQL_NTS,"myusername",SQL_NTS,
>"mypassword",SQL_NTS);

>But I am getting a compiler error that my string "myodbcconnection" is
>not of type
>unsigned char, which is how the statement is defined. The help files do
>this, but I cannot get it to compile.

>Amy help is appreciated.

>Kris Munch



 
 
 

1. Pro*C VARCHAR unsigned char Problem

I've got a bunch of Pro*C programs that have lines like the following:

VARCHAR var1[10];
strcpy(var1.arr,"hello");
var1.len = strlen(var1.arr);

This worked fine with Pro*C 1.6 on AIX 3.2.5, but I get errors about
converting unsigned and signed chars
since we have moved to the xlc compiler on AIX 4.1.  I removed #include
<string.h> and some of the errors
disappeared, but others like this remain (sprintf, etc.).  I know that a
VARCHAR is actually a struct that contains
an unsigned char, but I'd rather not have to explicitly type cast each of
these calls to (char *).  Is there an easy
way around this?

Phil

2. public listen id

3. How to get (unsigned char *) from _variant_t

4. Local Connection WITHOUT SQL net, possible?

5. I wonder why!!!! ESQL/C unsigned char

6. Client Access License

7. ODBC SQLConnect problem

8. PostgreSQL vs. Interbase

9. Win32 ODBC API Question on using SQLConnect() to Personal Oracle8i on Win2000

10. problem with char field and special ascii char