|
-
Apr 7th, 2009, 08:38 PM
#1
Thread Starter
New Member
Tearing hair out trying to read binary
I hope someone here can help me.
We have a SQL server database that had ID fields that used to be defined as integer.
The new version of the database has the ID fields defined as BINARY(16).
The VB project I am ugrading reads these tables and spits out Crystal Reports. The problem I am having is this portion of code:
Do While (adoOleDbDataReader.Read)
DoEvents()
ReDim Preserve strRptPars(iCount)
For i = 0 To adoOleDbDataReader.FieldCount
Select Case i
Case 0
strRptPars(iCount).lID = adoOleDbDataReader.GetInt32(i)
Case 1
strRptPars(iCount).sOranizationName = adoOleDbDataReader.GetString(i).Trim
End Select
Next
cboReports.Items.Add(strRptPars(iCount).sOranizationName)
iCount = iCount + 1
Loop
Obviously strRptPars(iCount).lID = adoOleDbDataReader.GetInt32(i) will not work with a column that is defined as BINARY(16). I have tried adoOleDbDataReader.toString(i) - this returns the letter 'S' every time, tried adoOleDbDataReader.GETGUID(i) - no dice as the column in SQL server must be defined as GUID, and so on. Can anyone help? I have been stuck on this for several days. Redefining the table column as a GUID will not work as GUID will store the binary number, but insert dashes in the ID (stored in strRptPars(iCount).lID) which cause selects later in the project to fail.
I am not sure what else to try.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|