🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages Started by Brian M. King Tue, 25 Oct 2005 17:46
Borland C++Builder 6 & ADO - Problem with uniqueidentifier
#620
Author: Brian M. King
Date: Tue, 25 Oct 2005 17:46
20 lines
2189 bytes
I'm using the ADO classes such as TADOQuery, TADOCommand, etc, to
communicate with an SQL Server database.  The problem I am having is
when I send a command to the database such as "SELECT SystemType FROM
SYS_HWDrivers WHERE ServerID='GUID'" (Where GUID is replaced by a valid
windows GUID), I get back a conversion error such as follows ..

SELECT SystemType FROM SYS_HWDriver WHERE
ServerID='{256724E7-E9DD-45DC-9F75-2E5072D9B855}'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting
from a character string to uniqueidentifier


I can't figure out why this is happening, I've tried with sending
through a TADOQuery object, and a TADOCommand object, I've even tried
giving it to TADOCommand->CommandText as a BSTR with the same results,
but if I put that same exact command into MS SQL Query Analyzer for
Enterprise Manager it works perfectly fine.  I've even tried explicitly
calling the SQL CAST() function with the same results.  It is urgent
that I get this working ASAP so any help is greatly appreciated, thanks.
Re: Borland C++Builder 6 & ADO - Problem with uniqueidentifier
#622
Author: Brian M. King
Date: Tue, 25 Oct 2005 19:43
6 lines
1618 bytes
Turns out the name was getting mangled during the process of parsing
through the Recordset I originally received, to get the GUID out of the
database and reuse for searching in other locations of the database
(Which is when I'd encounter the problem) .. Changed a few things
around and its working now, I knew it would end up being something
silly.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads