Yes, I can see now where this happens:
TempWideDataHolder = CoTaskMemAlloc(1);
// Set up array bounds
SA_Bounds[0].cElements = NumberRows + 1;
SA_Bounds[0].lLbound = 0;
SA_Bounds[1].cElements = NumberofCols;
SA_Bounds[1].lLbound = 0;
//Create array
resultp = SafeArrayCreate(VT_VARIANT, 2, SA_Bounds);
// Start Place column headers in first row
for (intCurrentColumn=0;intCurrentColumn< (ULONG)NumberofCols
;intCurrentColumn++) {
long indices[] = {0,intCurrentColumn};
VariantInit(&tmpVariant);
// Start Convert to unicode
WideCharacterLength=strlen(SQL_Results[intCurrentColumn]) + 1 ;
*TempWideDataHolder = (LPOLESTR)
CoTaskMemAlloc(WideCharacterLength*2);
MultiByteToWideChar( CP_ACP, 0, SQL_Results[intCurrentColumn],
strlen(SQL_Results[intCurrentColumn])+1, *TempWideDataHolder,
WideCharacterLength );
//Convert the VT_Object element to the BSTR - Here we may change if
SQLite type casts
tmpVariant.bstrVal=SysAllocString(*TempWideDataHolder);
V_VT(&tmpVariant) = VT_BSTR;
CoTaskMemFree(*TempWideDataHolder);
// End convert to unicode
// Safearray Column headers
hr = SafeArrayPutElement(resultp, indices, &tmpVariant);
SysFreeString(tmpVariant.bstrVal);
VariantClear(&tmpVariant);
}
// End Place column headers in first row
// Start Loop through array and fill SAFEARRAY
for (intCurrentRow=1;intCurrentRow<=(ULONG)NumberRows
;intCurrentRow++) {
for (intCurrentColumn=0;intCurrentColumn< (ULONG)NumberofCols
;intCurrentColumn++) {
long indices[] = {intCurrentRow , intCurrentColumn};
// set return array index
VariantInit(&tmpVariant);
sqlite_return_array_int= (intCurrentRow * (ULONG)NumberofCols) +
intCurrentColumn ;
// Start Convert to unicode
if (SQL_Results[sqlite_return_array_int]) {
WideCharacterLength=strlen(SQL_Results[sqlite_return_array_int])
+ 1 ;
*TempWideDataHolder= (LPOLESTR)
CoTaskMemAlloc(WideCharacterLength*2);
MultiByteToWideChar( CP_ACP, 0,
SQL_Results[sqlite_return_array_int],
strlen(SQL_Results[sqlite_return_array_int])+1,
*TempWideDataHolder,
WideCharacterLength );
//Convert the VT_Object element to the BSTR -
//Here we may change if SQLite type casts
tmpVariant.bstrVal=SysAllocString(*TempWideDataHolder);
V_VT(&tmpVariant) = VT_BSTR;
CoTaskMemFree(*TempWideDataHolder);
// End convert to unicode
hr = SafeArrayPutElement(resultp, indices, &tmpVariant);
SysFreeString(tmpVariant.bstrVal);
VariantClear(&tmpVariant);
}
}
}
// END Loop through array and fill SAFEARRAY
}
}
else
{
*ErrMsg = SysAllocStringByteLen( ErrMessage,strlen( ErrMessage) );
}
Now I will have to figure out how to re-code this.
RBS
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 06 March 2007 21:22
To: [email protected]
Subject: Re: [sqlite] What is wrong with this simple query (offset)?
"RB Smissaert" <[EMAIL PROTECTED]> wrote:
> Ah, thanks.
> I am not using the sqlite3 command line utility, but a VB adapted version
of
> the regular sqlite3.dll. I take it should be no problem to do the same
with
> that. Is there a pragma for this?
>
No.
The returning of field names is going to be a function of
your VB interface layer. The SQLite core does not do this
unless requested - which means that your VB interface is
requesting it. So turning of the field names is going to
be some sort of call into your VB interface, not into the
SQLite core.
--
D. Richard Hipp <[EMAIL PROTECTED]>
----------------------------------------------------------------------------
-
To unsubscribe, send email to [EMAIL PROTECTED]
----------------------------------------------------------------------------
-
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------