🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #5198

ODBC:SQLSetStmtAttr Error to set SQL_ATTR_PARAM_BIND_TYPE :Type mismatch

#5198
From: Changsong Bu
Date: Mon, 02 Jul 2001 15:27
24 lines
2071 bytes
I was trying to do the row-wise binding of parameters. I basically copied
the code from MSDN on line to my program:

SQLSetStmtAttr(hstmt1, SQL_ATTR_PARAM_BIND_TYPE, sizeof(InsertElement), 0);

-- where InsertElement is a simple structure as
struct InsertElement
{
    SQLUINTEGER  InsValue;
    SQLINTEGER  InsInd;
} ;

I got the following error message when compiling my codes:
- Cannot convert 'unsigned int' to 'void'
- Type mismatch in parameter 'Value' (wanted 'void *', got 'unsigned int').

I went back to check the SQLSetStmtAttr function in the reference. Seems the
Value field should be "Pointer to the value to be associated with Attribute.
Depending on the value of Attribute, ValuePtr will be a 32-bit unsigned
integer value or a pointer to a null-terminated character string, a binary
buffer, or a driver-defined value. " And in the comment part, it also states
"An SQLUINTEGER value that indicates the binding orientation to be used for
dynamic parameters. ". Everything seems right but why did I get this error?
Anything wrong with my settings? Any suggestion will be greatly appreciated.
Technical Details
Message-ID: <3b4092fe_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!newsfeed00.sul.t-online.de!t-online.de!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,46cb8a542dd1a866,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-07-02 08:39:15 PST
Reply-To: "Changsong Bu" <cbu@idax.com>
From: "Changsong Bu" <cbu@idax.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: ODBC:SQLSetStmtAttr Error to set SQL_ATTR_PARAM_BIND_TYPE :Type mismatch
Date: Mon, 2 Jul 2001 11:27:46 -0400
Lines: 28
Organization: Idax
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 199.10.116.249
Message-ID: <3b4092fe_1@dnews>
X-Trace: dnews 994087678 199.10.116.249 (2 Jul 2001 08:27:58 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!newsfeed00.sul.t-online.de!t-online.de!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews